Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dates in query

Status
Not open for further replies.

Lewy

Technical User
Nov 16, 2001
170
GB
Having done a search for the answer to my problem see thread177-650509, I am stumped. I have a query that looks at a table and using the following expression lists all records with dates in a particular month. For example ../12/2005 should give me all the records for December 2005, it shows nothing. Only by using 12/../2005 will I get the records. This has come about after a full re install after a hard drive failure. Language set in BDE is Paradox 'Intl'

Please help,

Lewy
 
Dates are stored/searchable in month/day/year format.

US way of doing things.

Your ../12/2005 is looking for any date on the twelfth day of any month.

Way to succeed is to use a criteria table for the query.

Fill it ahead of time (very fast with a tcursor) with all the days you want to include in the answer, and link it in the query.

Tony McGuire
"It's not about having enough time. It's about priorities.
 
Thanks Tony,

It used to work with the UK way of doing dates no problem at all, for some reason it doesn't since the reinstall. I can't help thinking I have got an incorrect setting somewhere.

Not sure I follow the criteria table method, never used one before.

Lewy
 
You may be able to adjust your date format in WINDOWS, as well as in Paradox, and use the messed up date format you are acustomed to <g>.

The criteria table for a qbe is simply a table of the values you wish to match.

qbe=query

:alias:criteria.db | datefield |
| _datevalues |

:alias:maintable.db | datefield |
| _datevalues |

endquery


Of course, your query would have to include the other stuff you would normally do to get the answer you need. The above is solely to help see usage of a criteria table.






Tony McGuire
"It's not about having enough time. It's about priorities.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top