Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Usability of date syntax in SQL
Message
From
10/04/2003 04:02:12
 
 
To
10/04/2003 00:50:49
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00775883
Message ID:
00775912
Views:
14
Have you tried
ldDate = DATE()
lcSQL = "SELECT Numero FROM News WHERE StartDate=CTOD( '" + DTOC( ldDate) + "')"
Its clunky though - with the CTOD in the expression that will get evaluated.

We use Private variables to pass variables in our SQL expressions - something you probably don't want to do but...

eg.
PRIVATE pdDate
pdDate = DATE()
lcSQL = "SELECT Numero FROM News WHERE StartDate = ?pdDate"
...pass SQL expression
RELEASE pdDate
and then have code to evaluate the variables prefixed with the question mark.

again, it has its downsides with the variable being available in other methods and PRGs, but the lifetime of the variable is usually quite short - and if you have a standard naming convention for the Private vars then they shouldn't really clash with others.
regards

Ian
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform