AnsweredAssumed Answered

Can some one explain less than or more than with dates?

Question asked by weedonpaul on Apr 21, 2016
Latest reply on Apr 21, 2016 by alecgregory

I have recently become VAT registered as of the first of the month so I have had to change my invoices to add vat where applicable.

 

first this is my understanding of the if statement:

if(x; do this ;otherwise do this)

 

I wrote a line of code:

If (end_date  >  1/4/2016; net_invoice_total *  (Clients::client_vat_rate) ; 0 )

 

end date is the invoice date. I want to, for all invoices after (greater than) 1/4/16, to work out the VAT, other wise it's zero.

 

however the above didn't work, it worked out the VAT for all invoices before the date and not after.

 

so I changed the inequality signs round so

If (end_date  <  1/4/2016; net_invoice_total *  (Clients::client_vat_rate) ; 0 )

 

this works but I'm confused as my understanding is:  earlier date < Later date, 1<4 , 1/4/16<2/4/16

 

your help is appreciated

 

Paul

Outcomes