Results 1 to 2 of 2

Thread: can any one help me with this query

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Posts
    5

    Red face

    i have a table named orders in MS Access database.This table has a column named dateofcreation.I want to extract data available in the table between two dates.These two dates are available in two text boxes say text1 and text2.The dates are entered in two the textboxes in the format dd/mm/yy.How can I write a query in such a way that i can extract data available in the table between these two dates.The database is MS ACCESS.
    Can any one help me out.
    Thank you.
    Pavan.D

  2. #2
    Fanatic Member
    Join Date
    Nov 2000
    Location
    Worldwide in the Sun
    Posts
    566
    [B]Try This[/]


    I set a date of 01/01/80 into the dateofcreation when its empty with the IIF command.

    code

    dbs.Execute "SELECT * FROM table" _
    & "WHERE " _
    &"IIF(ISNULL(table.dateofcreation),'#01/01/80#',table.dateofcreation) " _
    & "BETWEEN DateValue(' " & Text1 & " ') AND " _
    & "DateValue(' " & Text2 & " ') " , dbFailOnError


    Cheers
    Ray
    Ray

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