relpteadrap
New Member
So atm, Each workStation has a list of invoices for them, some workStations will have many invoices and some will have none.Each list of invoices is sorted ascending, and the most recent invoice is stored in 'lastInvoice'. The below code checks the date on the last invoice compares it to this month -12.If the invoice date is < , it is stored in the chosenInvoicesForRetention list.\[code\]if (lastInvoice.Invoice_Date < DateTime.Now.AddMonths(-12)) { chosenInvoicesForRetention.Add(workstation); }\[/code\]This all works fine...however instead of DateTime.Now.AddMonths(-12) I would like to recplace this with a value which is stored in another table.\[code\]workstation.Number_of_Months\[/code\]This returns the amount of months i.e between 1 and 12Iv played about with it Operator can't be applied to 'int' or system.datetime.Is it possible to pull the value of the month from the invoiceDate, and convert it to an int, then compare. as int etc....am I anywhere near correct?Please advise...thank ye