Hi,
this is about replacing batteries every year. im using vb.net2008, msaccess2007. i need the right sql statement that will show me the devices that need replacement after a year(365 days). i want to compute the last-date-installed against current-date(today's date). and this is done from vb.net. any input, ideas, suggestions is greatly appreciated.
thank you very much in advance
p.s. if this is not the right forum, would you redirect me to the right one.
thanks again
Vb.net, sql and dates
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Jiteendra SampathiraoRank #586 · 4.1K pointsPosted Nov 12, 2010, 2:12 AM EST
Use the Date difference method.
Datediff: Returns the count (signed integer) of the specified datepart boundaries crossed between the specified startdate and enddate.
Syntax:
And write the if condition like if (days>=365) { //your business logic goes here } If this post helped you, then tick the "Do you like this Answer" checkbox which is placed at above this post.