Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
bndck
Starting Member
7 Posts |
Posted - 2011-01-20 : 01:30:41
|
| Hi,,This is my statement which gives me error as "syntax error in string in query expression '45')"Con.Execute "INSERT INTO Sold_Products_Temp(Date_sold,Product_Code,Description,Sold_rolls,Sold_mts,Category) VALUES (#" & DTPicker1.Value & "#,'" & Text1(0).Text & "','" & Text1(1).Text & "'," & toNumber(Text1(5).Text) & "," & toNumber(Text1(6).Text & " ,'" & Text1(4).Text) & "')"can anyone suggest sollution plz.many thanks |
|
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2011-01-20 : 04:27:49
|
| #" & DTPicker1.Value & "# should be '" & DTPicker1.Value & "' is all I can see. |
 |
|
|
bndck
Starting Member
7 Posts |
Posted - 2011-01-20 : 04:51:23
|
quote: Originally posted by RickD #" & DTPicker1.Value & "# should be '" & DTPicker1.Value & "' is all I can see.
Thanks RickD,I triedsame error with "345" error codesyntax error in string in query expression '45')..many thanks |
 |
|
|
Lumbago
Norsk Yak Master
3271 Posts |
Posted - 2011-01-20 : 06:57:56
|
| Do like this instead:SQL = "INSERT INTO Sold_Products_Temp(Date_sold,Product_Code,Description,Sold_rolls,Sold_mts,Category) VALUES (#" & DTPicker1.Value & "#,'" & Text1(0).Text & "','" & Text1(1).Text & "'," & toNumber(Text1(5).Text) & "," & toNumber(Text1(6).Text & " ,'" & Text1(4).Text) & "')"Response.Write(SQL)Response.EndCon.Execute(SQL)- LumbagoMy blog-> www.thefirstsql.com |
 |
|
|
bndck
Starting Member
7 Posts |
Posted - 2011-01-20 : 07:56:30
|
| Hi Lumbagothanks for your reply,.still error..many thanks |
 |
|
|
nigelrivett
Master Smack Fu Yak Hacker
3385 Posts |
Posted - 2011-01-20 : 08:50:06
|
| Have you looked at the string that is created?==========================================Cursors are useful if you don't know sql.SSIS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
|
|
|
|
|