none
Syntax Error with "=Today()"

    Question

  • Hi,

    Silly problem: when ever I try to put in =Today() into a placeholder in Visual Studio, I get a syntax error (indicated both by the red underlining around the two brackets, and the error that I get when I try to build the report).

    I thought this was the normal way of representing today's date? Am I missing something? How should I be getting today's date in a query?

    Help!

    Thank you.

    Wednesday, September 5, 2012 4:21 PM

Answers

  • Hi There

    Thanks for your posting. Can you please try this one

    =Now.Today 

    OR

    =Today

    =Now.Today  
    OR
    =Today 

    and see if this make any difference for you

    I hope this will help.

    Please let me know if you have any questions

    Many Thanks

    Syed Qazafi Anjum

    Please click "Mark as Answer" if this resolves your problem or "Vote as Helpful" if you find it helpful

    • Marked as answer by _AJ_TUS_ Thursday, September 6, 2012 7:12 AM
    Thursday, September 6, 2012 12:03 AM
    Moderator

All replies

  • Hi,

    i don't see any issue in your formula , i tried it on 2008 R2 and it works fine for me.Let me know which version you are using.


    *Regards*
    *Samay Shrivastava*
    *Please mark it as Answered if it answered your question or mark it as Helpful if it helped you solve your problem.*

    Wednesday, September 5, 2012 4:55 PM
  • Hi,

    =Today() should work fine. Try running the report and see what you find, it might work just fine. To do it in the query, you'll have to use the GETDATE function(assuming you are using SQL Server data source).

    SELECT GETDATE(), Column1, Column2....
    FROM Table....

    Hope this helps!


    Shahfaisal Muhammed http://shahfaisalmuhammed.blogspot.com

    Wednesday, September 5, 2012 5:42 PM
    Moderator
  • Hi There

    Thanks for your posting. Can you please try this one

    =Now.Today 

    OR

    =Today

    =Now.Today  
    OR
    =Today 

    and see if this make any difference for you

    I hope this will help.

    Please let me know if you have any questions

    Many Thanks

    Syed Qazafi Anjum

    Please click "Mark as Answer" if this resolves your problem or "Vote as Helpful" if you find it helpful

    • Marked as answer by _AJ_TUS_ Thursday, September 6, 2012 7:12 AM
    Thursday, September 6, 2012 12:03 AM
    Moderator
  • Thanks for this, Syed - it was solved by =Now.Today

    (FYI - I'm running Visual Studio 2008, with a SQL server datasource)

    Thanks for all your input!

    Thursday, September 6, 2012 7:16 AM