how to solve this date problem....

M

miles

Hi
i need help. how to solve this problem ? when i run the select quer
with the criteria there is onli one record show. but i have 276 dat
there should be about 100 data should be shown on the query but i
never happen.

is it my formula wrong ?????

field name: eff_date
criteria:
IIf([dbo_currency].[curr_code]='sgd',#1/1/2001#,([dbo_currate].[eff_date])>[Forms]![Year_Month_M]![cur-month
& "/" & [Forms]![Year_Month_M]![cur-year])


field name: date

criteria: >[Forms]![Year_Month_M]![end-month] & "/"
[Forms]![Year_Month_M]![end-day] & "/"
[Forms]![Year_Month_M]![end-year] An
<[Forms]![Year_Month_M]![start-month] & "/"
[Forms]![Year_Month_M]![start-day] & "/"
[Forms]![Year_Month_M]![start-year
 
D

Douglas J. Steele

You cannot use an IIf statement in the way in which you are. All you can do
is use it to provide a value, not have it change from an equality to an
inequality. Not only that, but if eff_date is a date/time field, you must
compare it to a complete date, not simply a month and year.

What you want to do is change your criteria so that you're looking for
records where
[dbo_currate].[eff_date])>DateSerial([Forms]![Year_Month_M]![cur-year],
[Forms]![Year_Month_M]![cur-month], 1) OR curr_code = 'sgd'
 
Top