![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have a DTS package scheduled to export data to a text file daily. Sometimes, on two consecutive days, the data exported are the same when the job runs as scheduled. If I run the job manually using the same parameters (date/time), the data are different. There is no particular pattern to it. Any ideas how I can trouble shoot this? Thanks Emma |
#3
| |||
| |||
|
|
OK The same statement is the same statement right so if I run it and you run it the results will be the same unless.... You mention dates here. So what I think may be happening is that the dates are being intrepeted differently. Depending on the language of the user and the server the same date may be interpreted differently 04/05/2005 is not the same to a US person and a UK person. To a UK person this is the 4th of May and to the US guy this is the 5th of April. To get rid of ambiguity can you specify the date in the format YYYYMMDD. so SELECT ...FROM...WHERE DateCol = '20050405' Do this with yourself and the scheduled invocation and let us know if the results are different. Allan www.SQLDTS.com "Emma" wrote: I have a DTS package scheduled to export data to a text file daily. Sometimes, on two consecutive days, the data exported are the same when the job runs as scheduled. If I run the job manually using the same parameters (date/time), the data are different. There is no particular pattern to it. Any ideas how I can trouble shoot this? Thanks Emma |
#4
| |||
| |||
|
|
I am already doing something similar. I may be approaching it the wrong way. Maybe some additional information will help. I have the following fields defined in my database and I would like to add the time to the date to perform a query. Date_provided datetime Time_provided varchar(6) The date is stored as follows: 2005-05-25 00:00:00.000 The time is stored as follows: 163547 (HHMMSS) Here is the select query that I use: select * from mr_information where convert(nvarchar,date_provided,112)+time_provided between N'20050517143059' and N'20050518143059' order by date_provided,time_provided DESC Where the information I want to select is between 2005-05-25 14:30:59 and 2005-05-26 14:30:59. Is this the right way to add tie time to the date? Thanks Emma "Allan Mitchell" wrote: OK The same statement is the same statement right so if I run it and you run it the results will be the same unless.... You mention dates here. So what I think may be happening is that the dates are being intrepeted differently. Depending on the language of the user and the server the same date may be interpreted differently 04/05/2005 is not the same to a US person and a UK person. To a UK person this is the 4th of May and to the US guy this is the 5th of April. To get rid of ambiguity can you specify the date in the format YYYYMMDD. so SELECT ...FROM...WHERE DateCol = '20050405' Do this with yourself and the scheduled invocation and let us know if the results are different. Allan www.SQLDTS.com "Emma" wrote: I have a DTS package scheduled to export data to a text file daily. Sometimes, on two consecutive days, the data exported are the same when the job runs as scheduled. If I run the job manually using the same parameters (date/time), the data are different. There is no particular pattern to it. Any ideas how I can trouble shoot this? Thanks Emma |
![]() |
| Thread Tools | |
| Display Modes | |
| |