IF Date Between two Fields

noletwin1

New Member
Joined
May 17, 2013
Messages
25
I have a table that has three columns, Beg_Date, End_Date, and Rpt_Month. I then have another table that has a Cal_Date. I want to create a field in the new table that if the Cal_Date is Between the Beg_Date and End_Date that it put out Rpt_Month.
 
You didn't mention that this was an Append Query. You seem to have a lot going on there, and it is difficult to decipher it all without having a full understanding of your data, table structure, and goals.

But I do think I see an issue. You have [StartDate] and [EndDate] in the HAVING clause of your query. You cannot put fields that are not part of what is being returned in your query in your HAVING clause. You can do that sort of thing with WHERE clauses, but not HAVING clauses, since HAVING clauses are applied to the data set AFTER it is generated (and not BEFORE like WHERE clauses are).
 
Upvote 0

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

Forum statistics

Threads
1,221,771
Messages
6,161,847
Members
451,723
Latest member
Rachetsely

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top