Skip to content

Instantly share code, notes, and snippets.

@kissmygritts
Created September 4, 2015 19:27
Show Gist options
  • Save kissmygritts/efdcbbfd0691a9791dd9 to your computer and use it in GitHub Desktop.
Save kissmygritts/efdcbbfd0691a9791dd9 to your computer and use it in GitHub Desktop.
Calculate sample year in SQL query. If month >= 6, SY = Current Year, Else SY = CY - 1
SampleYear: IIf(Month([data_Capture].[CapDate])>=6,Year([data_Capture].[CapDate]),(Year([data_Capture].[CapDate])-1))
@kissmygritts
Copy link
Author

IIF(data_Capture.ArrTime Is Null, FormatDateTime("12:00:00", 4), FormatDateTime(data_Capture.ArrTime, 4))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment