Microsoft
Software
Hardware
Network
Question : How to Calculate year to date
I am trying to get an SQL query to calculate the year-to-date on a mm/dd/yyyy date field (it gives only the first day of every month -- 7/1/2009, 8/1/2009, etc)
This would be the months starting in January 2009 through the current month.
I tried with
DateDiff("y",2,Date())
to get all of the years from #1/1/1900# to today, but that gives 40063 -- which I think is the number of days, not years.
Now I don't know how to use DateAdd to get this year's days and subtract from total days.
Thanks in advance for your help
Answer : How to Calculate year to date
You can use in a query:
Where
[YourDateField] Between DateSerial(Year(Date()), 1, 1) And Date()
/gustav
Random Solutions
Basic Question: how to get to VBA for Report Open Event
Opinion - best portable hard drive to backup SBS
Digging in to somebody else's stuff
Interrupt windowsw startup for installtion tasks
I have a Windows Server 2003 OEM key, but only a Windows 2003 Server Enterprise Edition Disk. How can I use the Enterprise edition disk to install regular Server (non-enterprise)?
Where are my e-mail messages?
Vista Activation?
File Upload & Download using ASP.net 2.5 & MVC2.0
I changed the motherboard and cpu on a panasonic cf-50 laptop. my hard drive is blue screening because of the new hardware How can I fix this without having to reformat the drive?
User Search and Disabling Application by Active Directory