dbTalk Databases Forums  

Re: Performing a query within a DTS job

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Re: Performing a query within a DTS job in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Performing a query within a DTS job - 12-10-2006 , 03:56 PM






Hello Mike,

Are you looking for this

Select * from table1
where dateopen = Getdate()

Getdate() though is very specific so maybe this is too granular. If the
data in the colu,m is datetime and is held with only a date and a midnight
time portion then you are probably wanting something like

Select * from table1
where dateopen = CAST(CONVERT(CHAR(8),getdate(),112) AS DATETIME)


Have a look in BOL for the other conversion codes for CONVERT()



Regards

Allan Mitchell
Konesans Ltd
T +44 7966 476 572
F +44 2071 008 479
http://www.konesans.com

Quote:
Need help on a query within DTS job.

Trying to retrieve data from database based on the current server
date. Any suggestions on how I can query/retrieve using the server's
date as a condition?

Ex.
Select * from table1
where dateopen = ?
dateopen = field column
field entry = 10/01/06



Reply With Quote
  #2  
Old   
Mike Chung
 
Posts: n/a

Default Re: Performing a query within a DTS job - 12-10-2006 , 05:35 PM






Allan,

Thank you for your response. I'm using something like this.

select * from matter
where mopendt = convert(char(8), getdate(), 112)

I believe this would help me retrieve data that are only good on the days
that I perform this query.

Michael

"Allan Mitchell" wrote:

Quote:
Hello Mike,

Are you looking for this

Select * from table1
where dateopen = Getdate()

Getdate() though is very specific so maybe this is too granular. If the
data in the colu,m is datetime and is held with only a date and a midnight
time portion then you are probably wanting something like

Select * from table1
where dateopen = CAST(CONVERT(CHAR(8),getdate(),112) AS DATETIME)


Have a look in BOL for the other conversion codes for CONVERT()



Regards

Allan Mitchell
Konesans Ltd
T +44 7966 476 572
F +44 2071 008 479
http://www.konesans.com

Need help on a query within DTS job.

Trying to retrieve data from database based on the current server
date. Any suggestions on how I can query/retrieve using the server's
date as a condition?

Ex.
Select * from table1
where dateopen = ?
dateopen = field column
field entry = 10/01/06




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.