2 Replies Latest reply: Apr 6, 2011 5:24 AM by Peter Rieper RSS

    Date creation problem

      Hi,

      I have 3 variables like: year=2011, month=02, day=01.

      I want to create date using these variables in the "YYYY-MM-DD" format.

      I went through the date help page and found

       

      Default setting 1

      Default setting 2

      Date format

      YY-MM-DD

      M/D/YY

       

      date( A ) where A=35648 returns:

       

      Setting 1

      Setting 2

      String

      97-08-06

      8/6/97

      Number

      35648

      35648

      Can you please guide me which formula has been applied here to convert the "97-08-06" into "35648"?

      I want to use same formula in my case.

      Thanks

       

        • Date creation problem

          with num( makedate(year,month,day)) if you want the date use makedate(year,month,day) in this way you force qv to make a date with that numbers

          • Date creation problem
            Peter Rieper

            First you have to use the MAKEDATE-function:

            MAKEDATE(year, month, day)

            This should transform your variables into a date, which will be displayed as in your settings for dates.
            If used in scripts, you may need to embed it into $(...), like other variables.

            If another display is required you may further embed with DATE-function.

            See the attached

            HTH
            Peter