Skip to Content
Former Member
Apr 01, 2009 at 08:18 PM

Expiration Date


I'm trying to create a query that automaticaly tells me which products have only 30 days left before they expire so I can create an alarm that runs automaticaly every day.

Here's my problem, I can't find a way to compare the expiration date [ExpDate] with the current date because the current date is in a datetime format, thus it can't be compared to a date only field...

I've been trying to convert the "[date]" using several SQL comands within the SBO query creator, but without any luck, I always get the same error, cannot convert datetime (or something like that)

I think there must be someone out there that "manages" products with expiration dates, so there must be someone that has already faced this problem before...

I basicaly want to create a simple query, something like:


ItemCode, BathchNum, ExpDate


Expdate <= "[date + 30]"

I left the Tables out because I'm having a problem with them as well, I haven't quite figured out which ones the data has to come from, I guess OIBT would be the main one, but I'm not sure

Could Someone help me??? (please)