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

if then else

Started by esanray, 06 Apr 2011 11:16:51 PM

Previous topic - Next topic

esanray

Database contain  the following data

Schedule time       Actual time.

01:10         04:00
02:00         05:00
04:00         08:00
05: 00         09:00

I need the report         

Hour wise      No of Train

Delay 2+hours         1
Delay 3+hours         1
Delay 4+hours         1

Can you please tell me the steps.

blom0344

Are Scheduled time and actual time real timestamps?

esanray


blom0344

something like:


'Delay '||
cast(_round(((extract(hours,[Actual_time])*60+extract(minutes,[Actual_time]))
-
(extract(hours,[Schedule_time])*60+extract(minutes,[Schedule_time])))/60,0),varchar(4))
||'+ hours'


for the hourwise definition



PRIT AMRIT

Nice one though, it will give you parsing error. The code should be
'Delay '||
cast(_round(((extract(hour,[Actual_time])*60+extract(minute,[Actual_time]))
-
(extract(hour,[Schedule_time])*60+extract(minute,[Schedule_time])))/60,0),varchar(4))
||'+ hours'


Should be Hour not Hours, Minute not Minutes..

Thanks

blom0344

PRIT, thanks for your correction..

esanray

syntax display parsing error

PRIT AMRIT

 ::).... What kind of error you are getting?

I had tested and worked fine for me. You must be missing something?