RexesOperator
Registered User.
- Local time
- Today, 06:05
- Joined
- Jul 15, 2006
- Messages
- 604
My first Case Statement!
I need to choose a value based on a date:
Select Case DATERECEIVED
< 01/01/1991 GST = 0
BETWEEN 01/01/1991 AND 01/07/2006 GST = .07
BETWEEN 01/07/2007 AND 31/12/2007 GST = .06
> 31/12/2007 GST =.05
I have no idea how to set this up (yes I have looked at examples, but I have not found any I can use as a template. This is part of a sales tax calculation in a report (Canucks will recognize this as the GST). I need to have the correct value for any past reports requested.
I have set this up as a gigantic IIF Statement (it works, but it's clumsy). If these values change, it will be much easier for whoever maintains this db to update them from a case statement.
I just need to know the format for the dates and ranges. I think I can figure out the syntax from there.
I need to choose a value based on a date:
Select Case DATERECEIVED
< 01/01/1991 GST = 0
BETWEEN 01/01/1991 AND 01/07/2006 GST = .07
BETWEEN 01/07/2007 AND 31/12/2007 GST = .06
> 31/12/2007 GST =.05
I have no idea how to set this up (yes I have looked at examples, but I have not found any I can use as a template. This is part of a sales tax calculation in a report (Canucks will recognize this as the GST). I need to have the correct value for any past reports requested.
I have set this up as a gigantic IIF Statement (it works, but it's clumsy). If these values change, it will be much easier for whoever maintains this db to update them from a case statement.
I just need to know the format for the dates and ranges. I think I can figure out the syntax from there.
Last edited: