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
Userenv 1054, DnsApi 11197 and Dhcp 1003 event viewer logs
Your user accounts are unexpectedly locked and event ID 12294 is logged in Windows Server 2003?
event id 1639 warning message on blackberry server
Update a table based on the FIRST record of a join (mySql)
Were can I find a Infopath 2007 trial?
Export Access Report(S) to Section(S) in Word
Combobox values updated when selected versus typed
Want to remove extra numerical information (zip codes, etc.) from a text file that has thousands of addresses to only leave a 10-digit phone number (area code + phone number)?
Has anyone run these scripts
hauppage 1212 and xbox 360. windows 7 pc