Hello all
What is the function that gives me a warning before 6 months of the effective date of merchandise
Hello all
What is the function that gives me a warning before 6 months of the effective date of merchandise
Access and VBA make a number of date functions available. It sounds as though you will need to use DateDiff() or DateAdd() but a bit more info would enable us to help you more.
If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
Bob Fitzpatrick
Thank you very much Bob Fitzpatrick
Inquiry
Expiration date medicine
Build a query for form or report. Try:
SELECT * FROM tablename WHERE Date() = DateAdd("m",-6,[date field]);
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
azhar2006,
What June has offered is called SQL. You can use this code as a RecordSource to a form. You can paste the code into the form's Record Source property field. While you are in Design View for your form, the Record Source field is found in the Property Sheet. The property field is loacted within the "Data" tab.
You need to place the name of your table and the name of the date field where it is indicated by the color red.
SELECT * FROM tablename WHERE Date() = DateAdd("m",-6,[date field]);
This will show all the records where the date field is equal to the current month minus 6 months.
Thank you very much BOB
Thank you very much JUNE
Thank you very much ITSME
It did not work with me
But I found an example in the forum to friend (JUNE7)
Between Date() And DateAdd("m",6,Date())
And it worked fine
Good work. There is more than one way to go about achieving your desired results. You can apply criteria in the "Access Query Builder" window. When you build a query, there are fields available to apply your criteria. You could use code like this example in the criteria field of a query object.
There is an option in the query builder to change the view. You can view the SQL of your query object by selecting "SQL View" in the upper left hand corner. You can paste code like this example into "SQL View".Code:Date() = DateAdd("m",-6,[date field]);
As you discovered, if you want to see a range of dates in your results, you will need to use the "Between" operator.Code:[SELECT *, [date field] FROM tablename WHERE Date() = DateAdd("m",-6,[date field]);