Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP DATE() vs. SQL GETDATE()
Message
 
À
25/04/2006 09:08:29
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows NT
Database:
MS SQL Server
Divers
Thread ID:
01115333
Message ID:
01116323
Vues:
14
>Sergey,
>
>What about
>...
>
> WHERE  Pickdetail.editdate >= '2006-12-01' AND Pickdetail.editdate < '2007-01-01'
>
>
>Yes, that works fine. Certainly, it's simpler than what I had contrived. I guess the reason I didn't go for this more direct approach to start with was because I had originally needed to query the last 31 days of data from any point in time when the query was run so I had tried: WHERE DATE()-31. I soon found out that my ODBC/MS SQL 6.5 connection didn't support this fucntion and tried using GETDATE()-31, instead and that's were my odyssey began. When this didn't "pan out" I started looking at DATEPART and, eventually, the CONVERT function. Later, when I moved to another query that involved fixed dates, I failed to try the simplist approach.
>
>Thanks,
>Robert

But can you use parameters for WHERE?
Something like:
 WHERE  Pickdetail.editdate >= ?m.tBeginDT AND Pickdetail.editdate < ?m.tEndDT
Then in your form:
tBeginDT = DTOT(DATE())
tEndDT   = DTOT(DATE()-31)
REQUERY([MyRV])
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform