PDA

Click to See Complete Forum and Search --> : SQL Syntax URGENT


karunakaran
Feb 14th, 2000, 01:20 PM
Hi all,
I have an access table and one of the field is entrydate (date and time is the datatype) field. I have customer id also.
For everyday transaction I need to know whether the customer is calling for second time.
I created query select * from [table name] where customer_id = '" & txtcid & "' and
*****(entrydate) = #'" & Date & "'#

***** what I need to do to convert the data&time field to a date format.

ie. I am referring the date as the system date.
Now my porblem is how to convert the database [date and time ] field into a date
for my query .
anyone help me please
My advance thanks.

karun

[This message has been edited by karunakaran (edited 02-15-2000).]

swindingland
Feb 17th, 2000, 09:43 AM
if you have not figured it out already.....
When you refer to the "Date" coming in, if this is a variable you created just format it: Format(YourDate,"MM/DD/YY")



[This message has been edited by swindingland (edited 02-17-2000).]

RogerH
Feb 17th, 2000, 03:33 PM
Hi,

the statement is

select * from [table name] where customer_id = '" & txtcid & "' and
Datediff(""d"", Date(), entrydate) = 0"

The datediff function with the "d" parameter calculates the difference between the date in days.

Roger

Elias
Feb 21st, 2000, 11:09 AM
You could also try date casting:
ie cdate(varDate)