views:

34

answers:

1

I am looking for a SQL function to use in a BOE Report to generate data from the month selected in the prompt and the previous six months.

A: 

Lookup DATEADD if this is TSQL. I might not have the syntax exact from memory, but sample below s/b pretty close.

Also -- "selectedMonth" should be an entire date (mm/dd/yy), not just a month number.

SELECT
   *
FROM
   table
WHERE [myDate] > DATEADD(month,-6,@SelectedDate)
dave