DTS Date Format issues

  • I currently have a DTS package with an execute sql task which outputs its result to a global variable. The sql code is

    select max(dateclocking) from clockings

    Then I have a transform data task with the following sql code as the source

    select ...... from clockings where dateclocking >?

    the question mark is set to the global variable. The problem is the date is seen as American format. As the global variable is currently 9th Nov this means I am getting all the data imported from 11th Sep onwards.

    Any suggestions of how to sort this out? Sure there is some simple way but I'm stuck for ideas.

  • Is the dateclocking column an actual datetime datatype? or is it a string?

    Try converting it

    Look at convert in books online.

    select max(convert(varchar(24),dateclocking,103)) from clockings

  • Yes both dateclocking fields are datetimes.

    Forgot to mention that I am moving the data from a table in an access 97 database called clockings which gets updated. The new data is then going to a table on sql server with exactly the same fields also called clockings.

    Tried that bit of code and now everything from the end of october onwards is imported.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply