Year() function and Month() function
Good Day Every one Currently im using this codes to get the data that are
with in a specific month
SELECT * from Table1 d
where
MONTH(d.fld_ExpiryDate)=@month
AND YEAR(d.fld_ExpiryDate)=@year
some of my colleagues told me to use the duration eg.
d.fld_LoanDate >= '2009-11-01' and
d.fld_LoanDate < '2009-12-01'
the question is would it be better to use the range?? and how would i
compute the start of the month and start of next month? if the users input
where just @month int and @year int?
any help would be greatly appreciated im new in tsql that's why i do not
know the work arounds and whats good or not in coding..
Thank You :)
No comments:
Post a Comment