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
How to use the UserGroup.GetUserLoginFrom<wbr />Email web service in Infopath
How to secure server 2008 network with wireless access point
Repair installation when unable to start Vista
File System Error (-1073741701) When attempting to run or attempting to load Vista SP1
Why delegate _msdcs to a DNS Zone?
What are the recommended alternatives to the Office Web Components when used in Microsoft Access
Use DOS Batch File to Expand Wildcard into Filenames
How do I change default accept meeting response to "Do not send response"?
vb.net - get ip address from host
C# -- About Box -- display "Publish Version"