Intime and OutTime for the Modified date

Posted by Jash on Stack Overflow See other posts from Stack Overflow or by Jash
Published on 2009-06-10T09:25:45Z Indexed on 2010/03/13 23:05 UTC
Read the original article Hit count: 255

Filed under:
|

Question is already posted on June 4, but still am not get the Proper answer

Again

Table Structure:

T_Person – Table 1

CARDNO 

168 
471 
488 
247 
519 
518 
331 
240 
518 
386 
441 
331

T_Cardevent – Table 2

CARDEVENTDATE CARDEVENTTIME 

20090225 163932
20090225 164630
20090225 165027
20090225 165137
20090225 165147
20090225 165715
20090225 165749
20090303 162059
20090303 162723
20090303 155029
20090303 155707
20090303 162824

Query

SELECT CARDNO,  CARDEVENTDATE, (1000000 * CAST (CARDEVENTDATE AS BIGINT) + CAST (CARDEVENTTIME AS BIGINT) - 30001) / 1000000 AS CardEvenDateAdjusted, CARDEVENTTIME
FROM T_CARDEVENT
WHERE (CARDEVENTDATE > 20090601)
GROUP BY CARDNO, CARDEVENTDATE, CARDEVENTTIME, (1000000 * CAST(CARDEVENTDATE AS BIGINT) + CAST(CARDEVENTTIME AS BIGINT) - 30001) / 1000000
ORDER BY CARDNO, CARDEVENDATEADJUSTED

From this above query date is displaying correctly according to that time 03:00:01 to 03:00:00

How can I get min (time) and Max (time) for the adjusted date?

I need the sql query for the above condition. Help me? Urgent Please

© Stack Overflow or respective owner

Related posts about sql

Related posts about query