Click here to Skip to main content
15,881,938 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi all visitors,

i have one table.In my table it has many rows,
i want to compare (11/2011) to (02/2012).
note: 11 and 02 are month,2011 and 2012 are year.
How can i compare them?

Thanks
TONY
Posted
Comments
wizardzz 13-Mar-12 12:14pm    
Are your months separate columns or, as I assume, rows? Are they strings or date values?

1 solution

If they're strings, you have to parse out the month and year using the SUBSTRING function. When you do that, you can create a new DateTime variable which can then be used with either the DATEDIFF function (to find the difference between the two dates), or the BETWEEN function (to see if another date falls between the two).

Use the Google, Luke...
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900