If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Help needed with time range

Started by actcognosuser, 05 Apr 2010 10:27:44 AM

Previous topic - Next topic

actcognosuser

All,
          I have a date/time field .I need to filter on a specific time interval.
I extrcated only time fro mthe filed using time(date/time).

Now i need to display time between 9.00 am to 3.00 pm.
I used Time between '09:00:00 AM' and '03:00:00 PM' in the filter
But it did not work.

Also can i specify a time range based on some condition.(i.e based on data item).
for example if dataitem is working day then display tim erange between 9:00 and 3:pm.

Please advise.

the_xxx

cast the data item to the required format.

actcognosuser

Should it be a string?I need a time interval.between 9:00 to 3:00?

Thanks in advance!

the_xxx

Some thing like this,

cast([ACTIVITY_TIME] as time) between cast(?StarTime? as time) and cast(?EndTime? as time)

or try converting to CHAR.

actcognosuser

Thank you.

I am still not able to get the desired results because i am hard coding the time as '8:00:00 am'

actcognosuser

All,
       Can we compare a date time value with a string?example
if ([Dataitem1] = 'Business')
then( [time(Date/Time field] between '9:00:00' and 3:00:00)
else
if ([Dataitem1] = 'Office')
then( [time(Date/Time field] between '9:00:00' and 5:30:00)
else()

To achieve this should I cast it to char?What is the best way to achieve this result
Thanks in advance!


actcognosuser

Can a string be compared with a date/time value with cast function?