MS ACCESS DateDiff function

Hello everyone, i'm trying to get the MS ACCESS's function DateDiff working in one of my report queries.

See the official function doc here : http://office.microsoft.com/en-001/access-...A001228811.aspx

Here is my SQL query :
SELECT                                    
      DateDiff("s", IIf([topstartdatefield]>:START_DATE,[topstartdatefield],:START_DATE), IIf([topenddatefield]<:END_DATE,[topenddatefield],:END_DATE),vbUseSystem,vbUseSystem )          
FROM mytable;

This exact query works fine inside MS ACCESS (the application) but fails when inside a FDQuery (I'm using FireDAC) in FastReport with an error telling that too few parameters had been provided and that 6 are required.
Sometimes when I change parameters i have the same message with 7, 8 or even 9 parameters required.

Mu guess is that there is sort of a name conflict between ms access's DateDiff Function that i'm trying to use and FastReport's built-in DateDiff() function.

Can anybody help me?

Thanks

Comments

  • edited 12:16PM
    Ok, I found the problem.

    I need to put the first parameter in simple quotes and not in double quotes.
    so 's' instead of "s"

    Hope this helps anybody

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.