Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DateTime Comparisons with SQL Server
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00051173
Message ID:
00051309
Vues:
38
Instead of passing the DATETIME() function simply store it in a variable and have your query as...

ltDate = DATETIME()
CREATE SQL VIEW "V_Order2" ;
REMOTE CONNECT "WAREHOUSE" SHARED AS ;
SELECT *;
FROM orders Orders;
ORDER BY Orders.timestamp ;
where Orders.timestamp > ?ltDate - 86000

I'm not quite sure whether this will work. <s> Did you check the {fn DATETIME()} instead of having it directly in your query.

Kamal

>How do I compare DATETIME() values in a SQL view?
>
>If I create a view like this:
>
>CREATE SQL VIEW "V_Order2" ;
> REMOTE CONNECT "WAREHOUSE" SHARED AS ;
>SELECT *;
> FROM orders Orders;
> ORDER BY Orders.timestamp ;
> where Orders.timestamp > datetime() - 86000
>
>I get an error for Incorrect syntax. What I want to do is see all
>records for today's date.
>
>I've played around with the SQL date functions, but can't seem to figure
>out a combination that allows me to compare these values. Seems that
>the view doesn't like VFP nor SQL functions on the right of the >.
>
>Any help appreciated...
>
>+++ Rick ---
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform