String comparisons

It appears that DA doesn’t like the following DALINQ:

  var d1 := StartDate.ToString('yyyyMMdd');
  var d2 := EndDate.ToString('yyyyMMdd');

  var fDataModule := new lpv8oelib.DataModule;

  var aq := from arec in fDatamodule.DataAdapter.GetTable<lpv8oelib.Data.adheader>
            where ((arec.FirstInsertDate>=d1) and (arec.FirstInsertDate<=d2)) 
            where (arec.PubNumber=PubText.Text)
            join crec in fDatamodule.DAtaAdapter.GetTable<lpv8oelib.Data.ccads>
            on crec.AdNumber equals arec.AdNumber 
            select new class(arec.AdNumber,arec.EntryYear,arec.PubNumber,arec.ClientNumber,crec.PrepayType,crec.ChargeAmount);

  var plist := aq.ToList;

In an old database we have, some date fields are stored as 8-character strings in the format yyyyMMdd.

In my previous programs using Delphi, I was able to write ADO SQL to do these comparisons using less than/greater than on strings.

Shouldn’t this also be supported in DALINQ? Strings comparisons using < or >?

Thanks

Hello

Unfortunately not all .NET languages even support < or > string comparison operations. F.e. C# won’t compile code like

bool r = "A" > "B";

So DA LINQ supports the string comparison operations in somewhat different form:

var data = from x in dataAdapter.GetTable<DataTable>() where x.Name.IsGreaterThan("Some_Value") select x;

You can find the full list of supported string comparison operations here:
http://wiki.remobjects.com/wiki/StringExtensions_Class

Regards

Thank you so much! Works perfectly.