L
Leslie W.
I'm having trouble with a SQL Script I'm working with.
SELECT tblDetails.Fund, tblDetails.Budget, tblDetails.RstrCat,
tblDetails.RstrCatName, tblDetails.ObjectCode, tblDetails.CobjDesc,
tblDetails.FiscalYear, tblDetails.Amount, tblDetails.ReportMonth,
DateSerial(IIf([ReportMonth]>6,Left([FiscalYear],4),Right([FiscalYear],4)),[ReportMonth]+1,0)
AS FYDate, tblDetails.RstrCatGroup, tblDetails.CostCenter,
tblDetails.DescDTL, tblDetails.IndcFnA, tblDetails.RecType
FROM tblDetails
WHERE
(((DateSerial(IIf([ReportMonth]>6,Left([FiscalYear],4),Right([FiscalYear],4)),[ReportMonth]+1,0))>=#7/1/2008#)
AND ((tblDetails.IndcFnA)<>"I") AND ((tblDetails.RecType)="IACT"));
I receive the error "Data type mismatch in criteria expression," so I think
there's a problem somewhere with the DateSerial script because when I remove
the criteria ">=#7/1/2007#", the query runs fine, and I can't figure out what
happened.
In the raw table this data comes from, the [ReportMonth] field is formatted
as a number.
Any advice would be appreciated. Thanks in advance!
Leslie
SELECT tblDetails.Fund, tblDetails.Budget, tblDetails.RstrCat,
tblDetails.RstrCatName, tblDetails.ObjectCode, tblDetails.CobjDesc,
tblDetails.FiscalYear, tblDetails.Amount, tblDetails.ReportMonth,
DateSerial(IIf([ReportMonth]>6,Left([FiscalYear],4),Right([FiscalYear],4)),[ReportMonth]+1,0)
AS FYDate, tblDetails.RstrCatGroup, tblDetails.CostCenter,
tblDetails.DescDTL, tblDetails.IndcFnA, tblDetails.RecType
FROM tblDetails
WHERE
(((DateSerial(IIf([ReportMonth]>6,Left([FiscalYear],4),Right([FiscalYear],4)),[ReportMonth]+1,0))>=#7/1/2008#)
AND ((tblDetails.IndcFnA)<>"I") AND ((tblDetails.RecType)="IACT"));
I receive the error "Data type mismatch in criteria expression," so I think
there's a problem somewhere with the DateSerial script because when I remove
the criteria ">=#7/1/2007#", the query runs fine, and I can't figure out what
happened.
In the raw table this data comes from, the [ReportMonth] field is formatted
as a number.
Any advice would be appreciated. Thanks in advance!
Leslie