View Single Post
  #17   Report Post  
Posted to microsoft.public.excel.programming
Jamie Collins Jamie Collins is offline
external usenet poster
 
Posts: 593
Default Import Access records to excel (parameter is a called funct)

"PSKelligan" wrote ...

I tried to add your sql to my query and it seemed to work ok except for the
-IIF portion of the statement. Any syntax isues that are preventing this?
Your little bit of sql, if it
will work in this statement will make all my problems go away.


I think you have a paren in the wrong place and some unwanted minus signs. Try:

SELECT
*
FROM
tblHistory
WHERE
date_Updated
Between
DateSerial(
Year(Now()),
Month(Now())-IIf(Day(Now())<16,2,1),
16)
And
DateSerial(
Year(Now()),
Month(Now())-IIf(Day(Now())<16,1,0),
15)
ORDER BY
tblHistory.date_Updated DESC
;

Jamie.

--