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
Re: problem with INSERT INTO command
Welcome to the forum :wave:
What database are you using?
Re: problem with INSERT INTO command
What are the field definitions of "UserOFTheMonth (id)" and "DayWiseRoster (id)" Are they exactly the same?
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)
Re: problem with INSERT INTO command
hello d.paulson,
Thank you very much for the support.
regards,