Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help with Building Where Clause for date range
Message
De
11/08/2004 09:02:16
 
 
À
11/08/2004 01:20:06
Randy Wessels
Screentek Business Solutions, Llc.
Phoenix, Arizona, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00931941
Message ID:
00932298
Vues:
21
I guess I don't see the point in converting a date to a string, and then using brackets to turn it right back into a date for the query...when it can simply be left as a date for the query.

BTW, Mark, I heard your presentation last night was really good, wish I could have seen it.

>
>>The issue here is the "SET STRICTDATE TO" setting. Your app must be setting it to 0 somewhere, but your development environment isn't. I generally turn the setting to 0.
>>
>>To make it work with the default setting of 1, you would need to format your date in the appropriate format (see the help file for more info on strictdate):
>>
>>
>>LOCAL lcWhere, lcStartDate, lcEndDate
>>lcWhere = ''
>>WITH THISFORM.txtStartDate
>> IF NOT EMPTY(.Value)
>>  lcStartDate = "^" + TRANSFORM(YEAR(.VALUE)) + ;
>>  	"-" + TRANSFORM(MONTH(.VALUE)) + ;
>>  	"-" + TRANSFORM(DAY(.VALUE))
>>  lcWhere = "AND invdate>={"+lcStartDate+"}"
>>ENDIF
>>ENDWITH
>>
>>WITH THISFORM.txtEndDate
>> IF NOT EMPTY(.Value)
>>  lcEndDate = "^" + TRANSFORM(YEAR(.VALUE)) + ;
>>  	"-" + TRANSFORM(MONTH(.VALUE)) + ;
>>  	"-" + TRANSFORM(DAY(.VALUE))
>>  lcWhere = lcWhere + "AND invdate<={"+lcEndDate+"}"
>>ENDIF
>>ENDWITH
>>
>>
Steve Gibson
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform