Reputation: 91
I'm trying to modify my currently-functional report to include new fields. I want to return records where LeavingDate falls between two date values. I've defined StartDate and EndDate as DateTime parameters and wrote the following Select Expert formula:
{LeavingDate} in {StartDate} to {EndDate}
No records are being returned. My previous report was saved in a peculiar fashion. (The Database Expert no longer states the tables from which the report was been created. Instead it states the name of the report as the data source.) There doesn't seem to be any selection formula but it prompts for parameters and functions correctly.
I tried using the formula below instead, but to no avail:
not(isNull({LeavingDate})) and
{LeavingDate} in {StartDate} to {EndDate}
How can I get data to return?
Upvotes: 0
Views: 969
Reputation: 225
I had some issues with a date range recently. It sounds like your issue might be more related to your connection to the database, but this solved our date range issue:
We truncated out each attribute (year, month, day) individually and put them together, this all using the Date()
function.
Date(Year({d1.birthdate}), Month({d1.birthdate}), Day({d1.birthdate}))
With this format I was then able to compare dates as expected.
Let me know if that doesn't solve it for you. In that case, we could then say the date format probably isn't the issue and move on to connection issues.
Upvotes: 2