Select statement

Hi…Experts

I have one doubt.I have one table.In that i have two date type fields. PostedDtae and PaymDate. So My requirment is caliculating PaymDate based on postdate i.e Paymdate = Mustbe always 13th of (Month Of PostedDate+1) it means if i enter postdate 1st april ,Payment date should show 14th May.

i want this only in X++ select Stmt. Not to use table level methods etc.

Thanks in advance.:slight_smile:

hi reddy,

I didn’t undertood your question correctly.
You said… it must be 13th, just the month changes based on the posted date month.
Then why 1st April → 14th May; I was thinking 1st April → 13th May?

Don’t make it as a separate field; it can be easily calculated whenever needed.

Use the following code, for example:

date d = nextMth(this.PostedDate);    
d = mkDate(14, mthOfYr(d), year(d));

Thanks Martin