Subject |
Re: Using Field Named DATE in Where clause |
From |
Ken Mayer <dbase@nospam.goldenstag.net> |
Date |
Wed, 14 Feb 2024 07:34:53 -0800 |
Newsgroups |
dbase.getting-started |
On 2/14/2024 1:27 AM, Craig wrote:
> I have a database for our orders where each order has the sales person name entered in as to show whose customer it is. using the Where clause I can sort the orders so that only a specific sales person orders show up.
>
> However I am trying to use the Where clause to only give out the orders from a specified numbers of days ago. The field name that I am working with is when the order was entered and is labeled as DATE. This seems to be giving issues also I can't seem to get the where function to filter using any of the date fields that I have in the table.
>
> I am not sure if I am setting up the clause wrong or how to filter using dates in the where clause.
Lots of good advice in this thread. Another option is to modify the SQL
statement and specify the fields you are using, this makes for a much
longer statement sometimes, but by doing so you can create a SQL alias
for the field in question:
select field1, field2, date as MyDate, field4, ...
Then in the where (or order by) clause you can reference "MyDate"
instead of "Date" and SQL won't get upset at you.
Ken
--
*Ken Mayer*
Ken's dBASE Page: http://www.goldenstag.net/dbase
The dUFLP: http://www.goldenstag.net/dbase/index.htm#duflp
dBASE Books: http://www.goldenstag.net/dbase/Books/dBASEBooks.htm
dBASE Tutorial: http://www.goldenstag.net/dbase/Tutorial/00_Preface.htm
dBASE Web Tutorial: http://www.goldenstag.net/dbase/WebTutorial/00_Menu.htm
dBASE DOS to Windows Tutorial:
http://www.goldenstag.net/dbase/DtoWTutorial/00_Menu.htm
|
|