Hello yall,
I have been asked to create this report and I am not sure how to get it started.
I have to write some code that will figure out what Quarter we are in based on the current date.
Our first quarter starts from April1, 2012.
I was thinking maybe it can be done using "case" statements.
Any suggestions???
0
Answers
This is the virtual table called 'Date', and it knows about quarters. Instead of programming your own date processing code, familiarize yourself with this virtual table.
RIS Plus, LLC
I have been able to detect which quarter we are in depending on the current date. Now I have created two new variables:- QuarterBegin (date) and QuarterEnd (date).
So if the current date for instance is May 23. I want it to determine all the 'Job No.' that fall in that quarter (which would be QuarterBegin = 04/01 and QuarterEnd = 06/31).
How can I do this without providing an explicit year (or does that even matter whether I enter a year or not). I want to make a my QuarterBegin and QuarterEnd generic. So that report would work in any year.
Any suggestions?
Also, right now it gives me an error that the type of conversion is not possible (date := decimal) which i dont understand since the QuarterBegin is off type date.
If you know the quarter, you also know the quarter's start and end dates. Use those dates to set filters on the other table, so you can figure out the jobs between those dates.
About that error, that's a type conversion error. Somewhere you are trying to put a decimal value into a date type variable or vice versa (hard to tell without the actual error message). You need to make sure that you take care of aligning data types.
That's what programming is all about, you have to figure out the puzzle.
RIS Plus, LLC
This is the exact Error: - "The type of conversion is not possible because 1 of the operators contains an invalid type. Date := Decimal".
I am specifying QuarterBegin and End year to be 2012. Wouldnt that create a problem next year since my QuarterBegin and end would be in year 2013. Thats why I wanted to how to bypass this problem and somehow create a generic date, so year wont create an issue, no matter what year we are in.
if you want to enter date, enter it as 040112D (or is it 010412D??? :whistle: )
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Just one last question.
How can I Make QuarterBegin and QuarterEnd generic.
Right now, it would only work, if the year is 2012. But I want it to work for any year.
Any suggestions?
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.