cactusman
New Member
- Joined
- Oct 15, 2012
- Messages
- 20
Morning all!
Looking to create an Excel 2007 macro that takes a user-supplied start and and date and uses that to query an Access 2007 database and return records between such dates. I have been able to create a macro that gets all of the data but I cannot for the life of me figure out how to get it to use the dates.
Say, for example, I have a start date in cell B1 and end date in E1. I need to take those dates and add it to my SQL-type code (included below). The Access database used a date format like "MM/DD/YYYY HH:MM" where HH is 24-hour clock. I would like to remove the times from the mix entierly.
SQL as follows:
Thanks in advance!
Matt
Looking to create an Excel 2007 macro that takes a user-supplied start and and date and uses that to query an Access 2007 database and return records between such dates. I have been able to create a macro that gets all of the data but I cannot for the life of me figure out how to get it to use the dates.
Say, for example, I have a start date in cell B1 and end date in E1. I need to take those dates and add it to my SQL-type code (included below). The Access database used a date format like "MM/DD/YYYY HH:MM" where HH is 24-hour clock. I would like to remove the times from the mix entierly.
SQL as follows:
Code:
SELECT NCR.NCRNum, NCR.AddDate_NCR, NCR.CPIWarehouse, NCR.VendorNum, NCR.VendorName, NCR.PartNum, NCR.PartName, NCRLine.LineNum, NCRLine.Qty, NCRLine.DefectDesc, Initiator.Initiator, NCR.InspectorStamp, NCR.DueDate_CAR
FROM `J:\QUALITY\QUALITY ENGINEERING\CAR Development\NCR_CAR.accdb`.Initiator Initiator, `J:\QUALITY\QUALITY ENGINEERING\CAR Development\NCR_CAR.accdb`.NCR NCR, `J:\QUALITY\QUALITY ENGINEERING\CAR Development\NCR_CAR.accdb`.NCRLine NCRLine
WHERE NCR.NCR_ID = NCRLine.NCR_ID AND NCRLine.Initiator = Initiator.InitiatorID AND ((NCR.NCRNum>=3000) AND (NCR.Status_NCR<>'VOID'))
ORDER BY NCR.NCRNum, NCRLine.LineNum
Thanks in advance!
Matt