G
gwboolean
Guest
I have a query that I used to use with an ACCESS database that was purposed to compare dates in a specific column and filter where the date in that column = over 30 days old.
This worked fine for the ACCESS table. However, I have began using an SQL database/dataset and have noted that all of my old queries work the same, except I needed to replace the ? with @ParamN (N = integer). This has worked fine, until this query.
So how do I alter the ACCESS query to work with SQL?
ACCESS Table Query
SELECT intChangeID, strTitle, strRevision, strInitiator, strChangeType, strBaseObject, strOwner, strWhere, strChangeProposed, strChangeReason, strChangeResult, strChangeFile, dteOpen, dteSubmit, dteApprove, dteTrain, dteEffective,
dteClose, blnQualify, intSiTechID
FROM tblChangeRequest
WHERE (dteClose IS NULL) AND (dteOpen < DATEADD('M', 0, ?))
SQL Table Query
SELECT intChangeID, intProcessID, chrTitle, chrRevision, chrBaseObject, chrChangeMade, chrChangeReason, chrChangeResult, chrManager, intEmployeeID, chrOwner, chrWhere, chrProcedure, chrReport, dteOpen, dteSubmit,
dteApprove, dteTrain, dteEffective, dteClose, blnQualify, chrFilePath
FROM tblChangeMaster
WHERE (dteClose IS NULL) AND (dteOpen < DATEADD('M', 0, @Param1))
gwboolean
Continue reading...
This worked fine for the ACCESS table. However, I have began using an SQL database/dataset and have noted that all of my old queries work the same, except I needed to replace the ? with @ParamN (N = integer). This has worked fine, until this query.
So how do I alter the ACCESS query to work with SQL?
ACCESS Table Query
SELECT intChangeID, strTitle, strRevision, strInitiator, strChangeType, strBaseObject, strOwner, strWhere, strChangeProposed, strChangeReason, strChangeResult, strChangeFile, dteOpen, dteSubmit, dteApprove, dteTrain, dteEffective,
dteClose, blnQualify, intSiTechID
FROM tblChangeRequest
WHERE (dteClose IS NULL) AND (dteOpen < DATEADD('M', 0, ?))
SQL Table Query
SELECT intChangeID, intProcessID, chrTitle, chrRevision, chrBaseObject, chrChangeMade, chrChangeReason, chrChangeResult, chrManager, intEmployeeID, chrOwner, chrWhere, chrProcedure, chrReport, dteOpen, dteSubmit,
dteApprove, dteTrain, dteEffective, dteClose, blnQualify, chrFilePath
FROM tblChangeMaster
WHERE (dteClose IS NULL) AND (dteOpen < DATEADD('M', 0, @Param1))
gwboolean
Continue reading...