Errors Date Field

void Page1OnBeforePrint(TfrxComponent Sender)
{
CariKartDs.Close();
CariKartDs.SQL.Clear();
CariKartDs.SQL.Add("Select CariKod,KISAD,Mut_Date,Bakiye_Sekil,Risk_Kriteri From CariKart.db");
CariKartDs.SQL.Add("where Mut_Date>=:DateEdit1 and Mut_Date<=:DateEdit2");
CariKartDs.ParamByName("DateEdit1").Value=StrToDate("01.01.2005");
CariKartDs.ParamByName("DateEdit2").Value=StrToDate("31.12.2005");
CariKartDs.Open();

}
The following errors(s) occured:Type mismatch in expression.

How can I write "CariKartDs.ParamByName("DateEdit1").Value=StrToDate("01.01.2005");"

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 11:31PM
    assuming an fr dialog page with a query and date edits
    1 a frxdateedit control has the property date which takes a date
    unless you are modifying the whole query to select other fields
    use startdate enddate for example as params
    in the query's params property editor set the type and value for each parameter
    ie startdate would be date and value would be dateedit1.date.
    then you only have to modify datedit values instead of the whole query.
    NOTE that when working with an object's value property, value returns a variant,
    so you need to use vartostr() function to work with it.

    mismatch errors usually mean that you have supplied a value of the wrong type
    to what you are trying to supply to the objects property.
    ;)

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.