Results 1 to 4 of 4

Thread: SQL Syntax URGENT

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2000
    Location
    Singapore
    Posts
    59

    Post

    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).]

  2. #2
    New Member
    Join Date
    Feb 2000
    Posts
    1

    Post

    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).]

  3. #3
    Lively Member
    Join Date
    Dec 1999
    Location
    Karlsruhe, Germany
    Posts
    122

    Post

    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

  4. #4
    Member
    Join Date
    Oct 1999
    Location
    Snellville, GA, USA
    Posts
    38

    Post

    You could also try date casting:
    ie cdate(varDate)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width