ODBC - filter date with where condition

Discussion in 'Tally Integration' started by Sanket Patel, Jul 30, 2019.

    
  1. Sanket Patel

    Sanket Patel New Member


    How can i pass date in where condition of ODBC query.

    I tried
    Select * from [tablename] where $date > 20181201
    Select * from [tablename] where $date > 01122018
    Select * from [tablename] where $date > '01122018'

    none of them are working.

    Please help.
    Thanks
     


  2. teja varma

    teja varma Active Member


    in the calculator panel or external application
     


  3. Sanket Patel

    Sanket Patel New Member


    i am not asking where to run it.

    My issue is "date" field. Whatever i type in "date" field, it does not return anything in result.
     


  4. teja varma

    teja varma Active Member


    use tdl function $$Date to convert string to date :
    Select * from [tablename] where $date > $$Date:"2018-12-01"

    the environment where you are executing the query will also have an effect
     


  5. Sanket Patel

    Sanket Patel New Member


    suppose following is my TDL file then where do i write $$date

    ;;The Collection TDL
    [Collection : All Vouchers]
    Type : Voucher

    Fetch : Date, VoucherNumber, Reference, VoucherTypeName, LedgerName, Narration, PartyLedgerName, Amount
    ;;EOF()
     


  6. teja varma

    teja varma Active Member


    ;;The Collection TDL
    [Collection : All Vouchers]
    Type : Voucher
    Compute:date :$$Date:$Date
    Fetch : Date, VoucherNumber, Reference, VoucherTypeName, LedgerName, Narration, PartyLedgerName, Amount
    ;;EOF()
     


  7. Sanket Patel

    Sanket Patel New Member


    worked well with one changes.

    as you advised
    Select * from [tablename] where $date > $$Date:"2018-12-01"
    but
    Select * from [tablename] where $date > $$Date:"20181201"

    it accept yyyymmdd (not yyyy-mm-dd)
     


Share This Page