Date parameters

juneau730

Board Regular
Joined
Jun 7, 2018
Messages
111
Happy Friday.

In my dBase, many queries have a >= or <= parameter, like such <=(Date()-365)

Is there a more accurate way to write this? One of the queries using this is missing one item that a different routine (pulling the same data) is picking up.
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
One of the queries using this is missing one item that a different routine (pulling the same data) is picking up.
This first thing to determine is which one is actually right.
So find out what the value is in the record that is missing, and then determine if it should or should not be included.

I could see how in a leap year, your calculation above might miss one day, and maybe you would want to use different date match to get the same day one day earlier.
However, we are not in a leap year, so the logic above should return the correct date.
So I think you need to investigate the difference. Maybe the logic in your other routine is faulty.
 
Upvote 0
Also beware of time data if your dates have times in them.

For instance,

9:15 AM on on Jan 1 (2019-01-01-09:00:15) is not less than or equal to Jan 1 as a date (2019-01-01 00:00:00). Specifically it is 9 hours and 15 minutes greater than Jan 1 as a date.
 
Last edited:
Upvote 0
Thanks for the input Joe4 and xenou. Was able to figure out what was going on. It was a combination of the other source being partially incorrect and my filter missing a "and not" parameter due to how the data queried.

All working correctly now.
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,771
Members
452,353
Latest member
strainu

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