Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Views pick up wrong records
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00112248
Message ID:
00112292
Vues:
22
Hello Sarah,

Another thing to consider is the data type of the date fields. Are they just date or are they datetime type fields. If datetime, then this will pose a problem that I ran into in the past...

Change your SQL where condition based on just the fields, not necessarily using

dtosdate (from field selection), but

e.entrydate >= ?dLowerEntry and e.entrydate <= ?dUpperEntry

Also, if it IS a datetime entry, make sure your parameterized values account for it by using the full day range by converting to DATETIME().

Example:
*/ To simulate a single date range, 
*/ lower and upper are same date
dLowerEntry  = {6/5/1998}
dUpperEntry  = {6/5/1998}

*/ If the fields are datetime, add 1 day to the upper date limit
*/ and use the < symbol only.
select *;
  from a, b, c, d, e;
  where dtot( dLowerentry ) >= e.entrydate;
    and e.entrydate < dtot( dUpperEntry +1 )
When the are converted, they will convert to
6/5/1998 12:00am and 6/6/1998 12:00am
Therefore the upper must be LESS without the equal sign and this will get all times within the given date range...

Hope this may help to solve your dilemma.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform