BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Compare dates in delphi with SQL

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.databases
View previous topic :: View next topic  
Author Message
Orban Levente
Guest





PostPosted: Tue Jul 25, 2006 8:32 am    Post subject: Compare dates in delphi with SQL Reply with 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 *
Quote:
From reservation.db
Where date like 'Date'

What I am doing wrong?
Please help me...
Back to top
Dan
Guest





PostPosted: Tue Jul 25, 2006 7:49 pm    Post subject: Re: Compare dates in delphi with SQL Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.databases All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.