Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Date comparisons
Message
De
17/06/2004 16:13:28
 
 
À
17/06/2004 16:11:35
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00914601
Message ID:
00914786
Vues:
9
No, the original discussion seemed to be about BETWEEN. I just blew it with my example.


>>You're right in that comparison.
>
>OK ... I guess I thought that you were replying to Joe's wish for being able to use a date with LIKE so that
>LIKE '2004-05-04%' would imply that you want to retrieve all rows for that date regardless of the time, which unfortunately doesn't work. =(
>
>~~Bonnie
>
>
>
> We use it in a BETWEEN and since we don't do calls at midnight, the inclusive part of BETWEEN isn't a problem.
>>
>>
>>SELECT * FROM tblMain WHERE DateTimeField BETWEEN '20040504' AND '20040505'
>>
>>
>>My example was in error.
>>
>>Technically, the >= and < should be used, I'm just too lazy to type it. ;)
>>
>>BTW, it also works if you add hours, or hours minutes to it, but only for BETWEEN.
>>
>>
>>>Yeah, it works if your time is midnight, but that's it. Any other time does *not* get selected.
>>>
>>>~~Bonnie
>>>
>>>>>>>Bonnie that is a great point. I just wish I could simply use Like '2004-05-04%' :(
>>>>>>
>>>>>>Try this format '20040504'. SQL seems to have no problem with that.
>>>>>
>>>>>You sure about that Fred? I can't get that to work.
>>>>>
>>>>>~~Bonnie
>>>>
>>>>I do it all the time.
>>>>
>>>>
>>>>SELECT * FROM tblMain WHERE DateTimeField='20040504'
>>>>
>>>>
>>>>If you try this from Enterprise Manager, it complains about the date format, but the SELECT works just fine. Works in SPT from VFP, and I've done a couple of C# programs that use it just fine.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform