Depending on which database you are using the current date keyword may be different. Most DB's use CURRENT_DATE however MS SQLServer uses GetDate(), Access uses Now(). Another option would be to set the AutoSearch manually in the OnGetAutoSearchValues using the Delphi Routine Now().
That does not work, I have a MS SQLServer. If I put in my report with the AutoSearchCriteria CrediteurenMutaties.CM_DocumentDatum <= GetDate() And I Click on OK I get the error saying "error in SQL near )" The underneath SQL is produced, giving no date.
SELECT CrediteurenMutaties.CM_BedragValuta, CrediteurenMutaties.CM_Bedrag, CrediteurenMutaties.CM_Betaald, CrediteurenMutaties.CM_BetaaldBedrag, CrediteurenMutaties.CM_DocumentNr, CrediteurLink.CE_BE_ID, Relaties.RE_Bedrijfsnaam, Relaties.RE_Postadres, Relaties.RE_PostcodePostadres, Relaties.RE_PlaatsPostadres, Relaties.RE_Telefoon1, Relaties.RE_Fax, Relaties.RE_EMail, CrediteurenMutaties.CM_Omschrijving, Relaties.RE_ID FROM CrediteurenMutaties CrediteurenMutaties INNER JOIN CrediteurLink CrediteurLink ON (CrediteurLink.CE_ID = CrediteurenMutaties.CM_CE_ID) INNER JOIN Relaties Relaties ON (Relaties.RE_ID = CrediteurLink.CE_RE_ID) INNER JOIN Bedrijf Bedrijf ON (Bedrijf.BE_ID = CrediteurenMutaties.CM_BE_ID) WHERE ( CrediteurenMutaties.CM_DocumentDatum <= ) ORDER BY Relaties.RE_ID, CrediteurenMutaties.CM_DocumentDatum
Yes you are correct, I apologize for the confusion. ReportBuilder uses the daContainsSQLFunctionCall routine located in the daSQLReservedWords.pas file to determine if there is a valid function call in the search condition. In the current version of ReportBuilder it searches a very limited list of generic SQL function calls. This has been drastically updated and enhanced for the next major release of ReportBuilder (which is why I gave you the wrong information).
Currently you have three options.
1. Override the ContainsSQLFunctionCall routine in the TdaADOSession class of the ADO plug-in and add a check for the GetDate() function. 2. Add a new entry to the daBuildSQLFunctionList routine in the daSQLReservedWords.pas file for the GetDate() function.
aList.Add('GETDATE(');
3. Edit your SQL code manually without the help of DADE.
Comments
Depending on which database you are using the current date keyword may be
different. Most DB's use CURRENT_DATE however MS SQLServer uses GetDate(),
Access uses Now(). Another option would be to set the AutoSearch manually
in the OnGetAutoSearchValues using the Delphi Routine Now().
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
That does not work, I have a MS SQLServer. If I put in my report with the
AutoSearchCriteria
CrediteurenMutaties.CM_DocumentDatum <= GetDate() And I Click on OK I get
the error saying "error in SQL near )"
The underneath SQL is produced, giving no date.
SELECT CrediteurenMutaties.CM_BedragValuta,
CrediteurenMutaties.CM_Bedrag,
CrediteurenMutaties.CM_Betaald,
CrediteurenMutaties.CM_BetaaldBedrag,
CrediteurenMutaties.CM_DocumentNr,
CrediteurLink.CE_BE_ID,
Relaties.RE_Bedrijfsnaam,
Relaties.RE_Postadres,
Relaties.RE_PostcodePostadres,
Relaties.RE_PlaatsPostadres,
Relaties.RE_Telefoon1, Relaties.RE_Fax,
Relaties.RE_EMail,
CrediteurenMutaties.CM_Omschrijving,
Relaties.RE_ID
FROM CrediteurenMutaties CrediteurenMutaties
INNER JOIN CrediteurLink CrediteurLink ON
(CrediteurLink.CE_ID = CrediteurenMutaties.CM_CE_ID)
INNER JOIN Relaties Relaties ON
(Relaties.RE_ID = CrediteurLink.CE_RE_ID)
INNER JOIN Bedrijf Bedrijf ON
(Bedrijf.BE_ID = CrediteurenMutaties.CM_BE_ID)
WHERE ( CrediteurenMutaties.CM_DocumentDatum <= )
ORDER BY Relaties.RE_ID,
CrediteurenMutaties.CM_DocumentDatum
Best regards,
Rob Nowee
Yes you are correct, I apologize for the confusion. ReportBuilder uses the
daContainsSQLFunctionCall routine located in the daSQLReservedWords.pas file
to determine if there is a valid function call in the search condition. In
the current version of ReportBuilder it searches a very limited list of
generic SQL function calls. This has been drastically updated and enhanced
for the next major release of ReportBuilder (which is why I gave you the
wrong information).
Currently you have three options.
1. Override the ContainsSQLFunctionCall routine in the TdaADOSession class
of the ADO plug-in and add a check for the GetDate() function.
2. Add a new entry to the daBuildSQLFunctionList routine in the
daSQLReservedWords.pas file for the GetDate() function.
aList.Add('GETDATE(');
3. Edit your SQL code manually without the help of DADE.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com