| Author |
Topic  |
|
|
cplusplus
Constraint Violating Yak Guru
481 Posts |
Posted - 11/25/2012 : 17:25:22
|
Is it possible to between dates of whole month, if i pass just month number and year.
If i pass 10 & 2012
Can this be done:
where reg_dt_tm BETWEEN to_date('10/01/2012', 'MM/DD/YYYY') AND to_date('10/31/2012', 'MM/DD/YYYY')
or
If i pass 11 & 2012
where reg_dt_tm BETWEEN to_date('11/01/2012', 'MM/DD/YYYY') AND to_date('11/30/2012', 'MM/DD/YYYY')
Thanks for the helpful info. |
|
|
jimf
Flowing Fount of Yak Knowledge
USA
2868 Posts |
Posted - 11/25/2012 : 17:42:17
|
WHERE reg_dt >= DATEADD (month,@month-1, DATEADD(year,@year-1900,'19000101')) and reg_dt < DATEADD (month,@month, DATEADD(year,@year-1900,'19000101))
There is no to_date in sql server.
Jim
Everyday I learn something that somebody else already knew |
 |
|
| |
Topic  |
|
|
|