Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Inserting date into sql or firebird;What is .t. value in
Message
From
07/10/2005 08:17:11
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
01050571
Message ID:
01057121
Views:
9
>Hi Kerwan
>
>Try it this way, shouldn't be hard to miss.
>
>
?sqlexec(nHandle,'INSERT INTO X (date) values (' + FBDTOS({01/01/2005}) + ')')
>?sqlexec(nHandle,'INSERT INTO X (date) values (' + FBDTOS(DATE()) + ')')
>
>FUNCTION FBDTOS(tdDate)
>	RETURN "'" + TRANSFORM(YEAR(tdDate), "@L 9999") + "-" ;
>		+ TRANSFORM(MONTH(tdDate), "@L 99") + "-" ;
>		+ TRANSFORM(DAY(tdDate), "@L 99") + "'"
>ENDFUNC
Bhavbhuti,
Seeing ppl suggesting ways like this I wonder if FB doesn't support usual parameter passing? ie:
myDate = {^2005/1/1}
?sqlexec(nHandle,'INSERT INTO X (date) values (?m.myDate)')
It would be the first backend I hear that doesn't support it.

PS: RETURN "'" + TRANSFORM(dtoc(m.tdDate,1), "@R 9999/99/99") + "'"
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform