| Author |
Topic  |
|
|
moorthy123
Starting Member
USA
5 Posts |
Posted - 11/26/2012 : 15:13:44
|
Hi All,
Below query given me the exact date for dateid. for example: In date table, the dateID is 41048 and monthid is 1349 while i use the below query
SELECT CONVERT(DATETIME, 41048,101)
Output: 2012-05-21 00:00:00.000
i got the exact date for that dateid, but i could nt do the same for monthid. how could we get the monthid from that dateid
Thanks in advance
|
|
|
jimf
Flowing Fount of Yak Knowledge
USA
2865 Posts |
Posted - 11/26/2012 : 15:22:30
|
select datediff(month,-1,41048) , dateadd(month,1349,-1)
Jim
Everyday I learn something that somebody else already knew |
 |
|
|
moorthy123
Starting Member
USA
5 Posts |
Posted - 11/27/2012 : 10:14:52
|
| Thank you Jim. It works |
 |
|
| |
Topic  |
|
|
|