Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
if(Batch='A','18'&'/'&Month&'/'&Year,if(Batch='B','3'&'/'&Month&'/'&Year )) as due_date
now I want when I select a value like 18-12-2019 under the field name due date then I want output as 18-01-2020
Please tell me for this how to use add month function with a field name
I think you should create due_date like this
If(Batch = 'A',
MakeDate(Year, Month, 18),
If(Batch = 'B',
MakeDate(Year, Month, 3))) as due_date
If Month is not a number, but text, you can try this
If(Batch = 'A',
MakeDate(Year, Month(Date#(Month, 'MMM')), 18),
If(Batch = 'B',
MakeDate(Year, Month(Date#(Month, 'MMM')), 3))) as due_date
and then to add 1 month, you can just do this
AddMonths(due_date, 1)
I think you should create due_date like this
If(Batch = 'A',
MakeDate(Year, Month, 18),
If(Batch = 'B',
MakeDate(Year, Month, 3))) as due_date
If Month is not a number, but text, you can try this
If(Batch = 'A',
MakeDate(Year, Month(Date#(Month, 'MMM')), 18),
If(Batch = 'B',
MakeDate(Year, Month(Date#(Month, 'MMM')), 3))) as due_date
and then to add 1 month, you can just do this
AddMonths(due_date, 1)
Just by looking at the screenshot, I have no idea what you mean when you say it isn't working? Can you share your qvw and explain what exactly isn't working?
HI,
I have attached QVW with sample data. I am having following issue.
When I select batch 'B' following functionality is not working for batch 'B"
If(Batch = 'A', MakeDate(Year, Month, 18), If(Batch = 'B', MakeDate(Year, Month, 3))) as due_date
But its working fine for when I am selecting batch 'A'
for eg-
I want when i select batch 'B' if credit note date is 16-12-2019 ie greater than date 15th jan then packing slip date should be shown as 3 JAN 2020 and due date @wprc should be 3 jan 2020 +30 = 3 feb 2020
simillarly if batch ='A' ,credit note date is 2-12-2019 ie less than 15 Jan then Packing slip should be 18 dec 2019 and due date @wprc should be 18 jan 2020
so,above code is working fine when I select batch 'A' but not giving correct output for when I select batch='B"
Please check
Thanks
sakshi
Did you add this line:
AddMonths(due_date, 1)
?
Is this resolved now? You marked a solution to this post which is why I ask
Yes resolved