none
how to write this sql(oracle) in linq to entity RRS feed

  • Question

  • Hi All,

    Can someone please help me make this work

    How do i  write this code(oracle sql) in linq to entity
    select max(to_number(substr(seqno,5))) from
     tblmain where substr(seqno,1,2)='EX'
     and enterdate >= '2011/01/01'
    


    Thanks in advance for any help!

    Sunday, July 24, 2011 8:39 AM

Answers

  • finally i solved ...
     
    Private Const firstchar As String = "EX"
    Dim strdate = String.Format("{0}/01/01", Date.Now.ToString.Substring(0, 4))
    Dim query = (From q In db.TBLMAIN Where q.SEQNO.StartsWith(firstchar)
    AndAlso q.ENTERDATE >= strdate
    Select q.SEQNO.Substring(4)).Max()

    Sunday, July 24, 2011 11:44 AM

All replies