rbWiki > DADE > SQLBuilder > How To...Search on the Current Date

How To...Search on the Current Date

Table of contents
  1. 1. Question 
  2. 2. Solution

Question 

"How can I use SQLBuilder to search on the current date?" 

Solution

Use SQLBuilder to add a SearchCriteria item. For the search value, use the CurrentDate function to get the date and convert it to a string.

Download:  SQLBuilderSearchOnCurrentDate.zip 

Sample RAP code

procedure ReportBeforeOpenDataPipelines;
var
  lSQLBuilder: TdaSQLBuilder;
begin
  lSQLBuilder := TdaSQLBuilder.Create(Customer);

  lSQLBuilder.SearchCriteria.Add('Customer', 'LastInvoiceDate', '<', DateToStr(CurrentDate));
  
  lSQLBuilder.Free;

end; 
Tags
none

Files (0)

 
You must login to post a comment.