Show current date in textbox

  • Hi,

    I was hoping someone could tell me how I would set the value of a textbox or object to display the current date? I'm guessing I would do it using either vb.net or c#, I'm a newb at both.  Appreciate any help in advance.

     

  • Add this as your expression for the textbox:

    =Globals!ExecutionTime.ToLongDateString()

  • Thank you qallan, is that a vb.net expression?

  • wouldnt

    =Today

    work? after all thats wat the fuunction is for, displaying the current date.. format it if u dont want the timestamp or stuff...

  • Jason Thomas (10/26/2007)


    wouldnt

    =Today

    work? after all thats wat the fuunction is for, displaying the current date.. format it if u dont want the timestamp or stuff...

    Yes that would work Jason, I prefer to use the formatted version so that my end users see a more friendly date.

    =Today would show 10/29/2007 12:00:00 AM

    =Globals!ExecutionTime.ToLongDateString() would show Monday, October 29, 2007

    Also, using the built in Global function ExecutionTime I was guaranteed the time that the report was run which is what my client wanted and not today's date on a cached report.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply