Results 1 to 2 of 2

Thread: SQL Statment

  1. #1
    Guest

    Post

    Hi,

    "select * from " _
    & "tablename where " _
    & "date = #3/09/98#"

    How to pass a date variable, instead of passing the date directly. When I try to pass a variable I am getting a error that the data type mismatch. Please its a important for my job. Any help will do. Advance thanks.

  2. #2
    New Member
    Join Date
    Apr 1999
    Location
    Washington DC USA
    Posts
    3

    Post

    First off, change your fieldname "date" to "dtmDate".

    Next dimension a variable "dtmDateVar" as Date.

    "Select * From tablename Where dtmDate = #" & format(dtmDateVar, "mm/dd/yy") & "#;"

    That should do it.

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