Skip to main content
Announcements
Marching toward a simplified navigation! READ ON
cancel
Showing results for 
Search instead for 
Did you mean: 
vipin_mishra479
Creator II
Creator II

Date Issue

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.

5 Replies
Not applicable

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

vipin_mishra479
Creator II
Creator II
Author

hi sebablum.

thanks for reply but my question is that my every month started from 26 to 25

eg Apr - 26-03-2011 to 25-04-2011 and may - 26-04-2011 to 25-05-2011

Not applicable

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'))

senpradip007
Specialist III
Specialist III

Hi vipin,

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

Cheers

Pradip

Not applicable

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