![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
hi all ! i need a user to select a year from a list eg . 2007,2008,2009 when searching in a form that will run a query . however the date format in the table is eg. "31/3/09" . how can i just search through the year part of the date using this method ? i think there is some simple code you have to type in the query but im not sure what it would be. thanks |
#3
| |||
| |||
|
|
Assuming the date field is named SomeDate, include in your Query Builder Grid, define a calculated field as YearToSelect: Year([SomeDate]) and assuming the control where the user selects a date is "cboSelectDate" on Form frmMyQuery, in the Criteria line underneath the calculated field "YearToSelect" enter Forms!frmMyQuery!cboSelectDate. That ought to do what you want. I generally do not run Queries in applications, but show the data either in Forms or Reports, and I use the "WhereCondition" argument of the DoCmd.OpenReport or DoCmd.OpenForm statement in a similar way to select the data. *Larry Linson *Microsoft Office Access MVP "brino" <bdsolutions2... (AT) yahoo (DOT) com.au> wrote in message news:436df10d-b221-47af-824a-7f0766c95987 (AT) x29g2000prf (DOT) googlegroups.com... hi all ! i need a user to select a year from a list eg . 2007,2008,2009 when searching in a form that will run a query . however the date format in the table is eg. "31/3/09" . how can i just search through the year part of the date using this method ? i think there is some simple code you have to type in the query but im not sure what it would be. thanks |
#4
| |||
| |||
|
|
thats brilliant !! |
|
thanks for your help |
![]() |
| Thread Tools | |
| Display Modes | |
| |