 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Orban Levente Guest
|
Posted: Tue Jul 25, 2006 8:32 am Post subject: Compare dates in delphi with SQL |
|
|
Hello
I want to select those rows from a table where the datefield is the
same as todays date.
I am using Delphi 7 and Paradox 7 tables
My SQL lookes like this:
Select *
| Quote: | From reservation.db
Where date like 'Date' |
What I am doing wrong?
Please help me... |
|
| Back to top |
|
 |
Dan Guest
|
Posted: Tue Jul 25, 2006 7:49 pm Post subject: Re: Compare dates in delphi with SQL |
|
|
On 25 Jul 2006 00:25:31 -0700, "Orban Levente" <nykon_nss (AT) yahoo (DOT) com>
wrote:
| Quote: | Hello
I want to select those rows from a table where the datefield is the
same as todays date.
I am using Delphi 7 and Paradox 7 tables
My SQL lookes like this:
Select *
From reservation.db
Where date like 'Date'
This line tries to compare the contents of a column named "date" with |
a string constant "Date". What you need is:
WHERE date = TODAY
Also, even though Paradox will accept a column named "date", this is
not good practice since "date" is a reserved word in SQL and Delphi
both. Use something like indate or startdate or resvdate.
Secondly, LIKE has very special meaning in SQL. Don't confuse it with
the common misuse of the word in spoken English. Look it up in the
online help. If it doesn't show up in the Delphi help, just search for
it and add a shortcut on your desktop. The file is LOCALSQL.HLP.
hth,
Dan
| Quote: | What I am doing wrong?
Please help me... |
|
|
| 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
|
|