Options

Current Date in CODBC

nav123nav123 Member Posts: 3
edited 2006-06-02 in Navision Financials
Hello,

Can anyone help me with this -

I am trying to transfer (export) data from navision to Sql server using DTS. I need to bring a few records that have a date filter - date < current date - 5 days.

eg. select * from job where "Last Midifed Date" < getDate() - 5 days

How to get the current date in codbc. and how to manipulate(add or subtract days) it.

I am using DTS and want to execute this sql query.

Any help will be greatly aprecaited.

Thanks

Comments

  • Options
    varodvarod Member Posts: 14
    I get the same problem using C/ODBC with Navision 2.6. I solved it using this format string which is strange :

    dateField={d 'yyyy-MM-dd'}

    And for date manipulating i manage it in my code.

    I don't know if it helps you but i hope so !
  • Options
    nav123nav123 Member Posts: 3
    Hi Varod,

    Actually I need a function to get the current date in codbc. How to get the current date.

    I can not use the hardcoded value. I can do this using programming but I am using DTS where i need a Sql satement.

    Thanks
    Rekha
  • Options
    mr.mcgoomr.mcgoo Member Posts: 30
    If it's just the T/SQL function you need, then its GetDate() and if you want to go back 5 days it's DateAdd(dd, -5, GetDate())

    Just to be complete, there is a GetUTCDate() which gives GMT to avoid time zone issues if you have any.
    Regards
    Mr McGoo
Sign In or Register to comment.