|
-
February 16th, 2009, 01:00 PM
#1
problem with INSERT INTO command
Hello Readers,
I'm facing problem in one of my different INSERT command. the code is:
Code:
sql = "INSERT INTO DayWiseRoster (id) select UserOFTheMonth (id) where emp_id='" & txtempid.text & "'"
This command prompting: DATA TYPE MISMATCHED.
Couldnt find what the problem is. I need such code for data validation. I guess passing integer value with reference of another integer value creates the problem. Is there any different SQL code for passing integer value.
the same command i used in my program for different table. That one is:
Code:
ssql=" INSERT INTO UserOfTheMonth (emp_id) SELECT users (Emp_id) where name='" & cboname.text & "'"
Its working fine but the first one is creating problem. Can any one rid me of it??
Please.....
regards
-
February 16th, 2009, 01:37 PM
#2
Re: problem with INSERT INTO command
Welcome to the forum 
What database are you using?
-
February 16th, 2009, 02:36 PM
#3
Re: problem with INSERT INTO command
What are the field definitions of "UserOFTheMonth (id)" and "DayWiseRoster (id)" Are they exactly the same?
-
February 16th, 2009, 08:03 PM
#4
Re: problem with INSERT INTO command
My guess is that emp_id is an interger or a long integer, so the string delimiter should be removed.
Code:
sql = "INSERT INTO DayWiseRoster (id) select UserOFTheMonth (id) where emp_id= " & clng(txtempid.text)
-
February 17th, 2009, 04:24 AM
#5
Re: problem with INSERT INTO command
hello d.paulson,
Thank you very much for the support.
regards,
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|