Hey, how can I do a calculated field in a query based off another field in the same query?
Here is what I have:
DayID (number)
Payment (number)
I want the calculated field TotalPayment to be changed based off of the dayID.
So, if the DayID = 1, then I want 100 added to Payment
If the DayID = 2, then I want 200 added to Payment
Here is a sample of what I want the query to look like:
ID EmployeeID DayID Payment TotalPayment
1 1 2 150 350
2 1 1 145 245
etc..... (so the amount added is based off of the DayID in that row)
How would I go about doing this? I tried an If then statement, but that doesn't work in a query. I also tried a SelectCase. Any help would be greatly appreciated! Thanks in advance.
-Chris
Here is what I have:
DayID (number)
Payment (number)
I want the calculated field TotalPayment to be changed based off of the dayID.
So, if the DayID = 1, then I want 100 added to Payment
If the DayID = 2, then I want 200 added to Payment
Here is a sample of what I want the query to look like:
ID EmployeeID DayID Payment TotalPayment
1 1 2 150 350
2 1 1 145 245
etc..... (so the amount added is based off of the DayID in that row)
How would I go about doing this? I tried an If then statement, but that doesn't work in a query. I also tried a SelectCase. Any help would be greatly appreciated! Thanks in advance.
-Chris