Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Converting VFP date type to SQL SmallDateTime
Message
From
04/08/2005 17:00:53
 
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
01038556
Message ID:
01038730
Views:
22
>>
>>
cSqlInsert = "insert into Company (	MYDATEFLD ) values " + ;
>>	"(" + IIF(lfdate="NULL",[NULL],[']+lfdate+[']) + ")"
>
>Fred,
>
>This is kind of sort of what I did, your code is obviously more elegant <g>. Thank you very much.

Actually, if your field in SQL is a datetime type field, I'd do it this way:
lfdate = NULL   && note no quotation marks!
cSqlInsert = "insert into Company (	MYDATEFLD ) values " + ;
	"(?lfdate)"
This should work if the lfdate contains a NULL value or a date value.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform