Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Time report parameter
jdevanoff
I have a report for viewing current day transactions and want to allow users to specify a time range (e.g., 6:00 AM to 1:12 PM). The report parameters (from/to) are bound to a SQL query parameters for transaction date/time. Therefore, the query needs to receive (for example) 9/6/2011 6:00 AM as the "from" time - not just the 6:00 AM that I want the user to enter. As mentioned above, this report is only for current day transactions, so I don't want the users to enter the full date/time as they could then enter a date further back.
I tried creating the report parameters as time data type and as date/time data type. I set the "format as" to "h:mm a" in order to "hide" the date part and then set the default value to the current date, midnight. Unfortunately, editing the from time changes the date to Jan 1, 1970. Creating as a time data type works as expected, but that just gives the time when I need to pass the date/time into the query.
Suggestions? Is it possible to modify the report parameter's value by concatenating the current date + the time parameter to get date/time prior to running the query? (I usually just append to the query where clause using javascript instead of using bound parameters.) If that will work, how can I set the default "to" time to the current time? All the BirtDateTime functions seem to return either date/times or integers.
Find more posts tagged with
Comments
mwilliams
Hello,
One thing you could do would be to grab the hours and minutes from the times specified and use those in your beforeOpen script of your dataSet to build the appropriate dates and pass them to your queryText. Let me know if you have questions.