Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SqlExec() syntax
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows 2000 SP4
Database:
MS SQL Server
Miscellaneous
Thread ID:
01062739
Message ID:
01062742
Views:
14
The datetime fields cannot be empty in SQL Server. Usually NULLs are used instead in which case IS NULL operator cabn be used.
There're no logical data type in SQL Server. You can use any integer field instead.
IF someDateField IS NULL
...
IF someLogicalField = 0
>VFP has many fine string functions that help get the job done. In my conversion to using MS SQL I have discovered the very easy-to-use sqlExec() function. However, not all VFP functions can be sent via sqlExec(). For the moment its the empty() function. So here is the question how do you code in sql the Empty() function of VFP:

>if empty(someDateField) ....
>if !empty(someDateField) ....
>if ctod("01/01/2005") ....
>if dtos(someDateField) ....
>if empty(someCharField) ....
>
>if empty(someLogicalField) .... Select someLogicalField = 0 ?
>if !empty(someLogicalField) .... Select someLogicalField = 1 ?

>is and empty field filled with nulls?
>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform