Appending a date value to another table

mulhouse

Eric Arthur
Local time
Today, 03:20
Joined
Jan 10, 2008
Messages
1
Hi

I am trying to write an update query which will return a value within a new table, based on a date in my import table.

The date format is dd/mm/yyyy and I want to return the month in another column (ie 01 to 12).

To complicate matters, I want to return a value based on some additional logic. My invoice statements run on a cycle of 17th of the month to the 16th of the next month.

So if a date value in a line item of text in table 1 says 17/11/2007 to 16/12/2007, I want the value returned in my new column to be 11. If the date range is from 17/12/2007 to 16/01/2007 then I want the value returned as 12.

My American colleague wrote the following expression, but due to the different way we write dates in Europe, can't quite get this to work.



Expr1: IIf(Day([call date])<17,Month([call date])-1,Month([call date]))


I'd be grateful for any thoughts.


best regards

Mulhouse.
 
There's no reason why this shouldn't work with UK formatted dates. In what way does it not work?
 
IIf(Day([call])<17 And Month([call])>1,Month([call])-1,IIf(Day([call])<17 And Month([call])=1,12,Month([call])))

This should work
 

Users who are viewing this thread

Back
Top Bottom