5 Replies Latest reply: Aug 13, 2012 4:57 AM by Sebastian Blum RSS

    Date Issue

    Vipin Mishra

      hi,

      I have a date field and i just want to month of the date but my problem is that my Apr month started by 25-03 to 26-04 how can i convert it

       

      i am uploading a qvw.

        • Re: Date Issue
          Sebastian Blum

          Hi,

           

          I don't really understand the problem. Why should April start on 25th of March? But I observed in your example that your data may not be recognised as date, which might cause trouble. Your date format is set to

                 SET DateFormat = 'M/D/YYYY';

          but your listbox shows DD-MM-YYYY format. This indicates that your data are imported as text only.

           

          You haven't uploaded the source data (Excel), but I assume that you must check the date format in Excel, define the same format (SET DateFormat = ...) in your QV application and the import will work. If you must convert the input, use functions like Date(), Left(), Right() and Mid().

           

          This is not a complete solution, but I hope the idea contributes to find the cause for your problem.

           

          Regards,

          Sebastian

           

          • Re: Date Issue
            Felim Shanaghy

            Try something like

             

            if(DAY(Date(@1,'DD-MM-YYYY'))>25,Num(Month(Date#(@1,'DD-MM-YYYY')),'00')+1,Num(Month(Date#(Date_Rate,'DD-MM-YYYY')),'00'))

            • Re: Date Issue
              Pradip Sen

              Hi vipin,

               

              Please try this one and reply me is it fine or not.

               

              Cheers

              Pradip

              • Re: Date Issue
                Sebastian Blum

                Sorry for the late reply. Your description gives me another simple idea: What about generating a calendar with date as key field and adding a field like "ReportMonth" into the calendar? Then you could read your month directly from there, i.e. you have both the reporting month and the month of the date as fields in your data model.

                 

                Regards,

                sebablum