 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Guest
|
Posted: Fri Jan 05, 2007 12:27 am Post subject: SQL date range question |
|
|
I'm using Local SQL/Paradox with Delphi 7.
I have a pretty simple query where i'm filtering the records by date
and account #.
Sql.Add('and gla_date >=
'+QuotedStr(GetSQLDate(DateToStr(dtpFromDate.Date))));
Sql.Add('and gla_date <=
'+QuotedStr(GetSQLDate(DateToStr(dtpToDate.Date))));
Sql.Add('and gla_accnt >= '+From_account.Text);
Sql.Add('and gla_accnt <= '+To_account.Text);
This returns everyhting within the date and account ranges.
The problem is that I do not want records where gla_period=0 to be
filtered by date, I want those results returned even if the date of
those records is outside of the the date range.
Is there any way this can be accomplished? |
|
| Back to top |
|
 |
Guest
|
Posted: Fri Jan 05, 2007 3:09 am Post subject: Re: SQL date range question |
|
|
Putting "or gla_period=0" after where and before the and's without
parenthesis does the trick. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|