Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Posts
    25

    Unanswered: how to code this?

    i have a table in which date is written as mm/dd/yyyy now i have a form with a combo box with only year(yyyy) and a buttton which when pressed should generate a report based on a query for that year how can write this query to compare the Year part only.

    i mean to say that how do i compare the year in the combo box to the year in the table (not the whole date).


    awaiting your replies
    thanks in advance
    Last edited by somanchivasu; 04-05-04 at 15:18.

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713

    Re: how to code this?

    Originally posted by somanchivasu
    i have a table in which date is written as mm/dd/yyyy now i have a form with a combo box with only year(yyyy) and a buttton which when pressed should generate a report based on a query for that year how can write this query to compare the Year part only.

    i mean to say that how do i compare the year in the combo box to the year in the table (not the whole date).


    awaiting your replies
    thanks in advance
    "SELECT * FROM MyTable WHERE (DatePart('yyyy',[DateFieldHere])=" & Forms![FormNameHere].MyComboBox.Value & ");"

Posting Permissions

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