dbTalk Databases Forums  

DayOfWeek - Determining in ActiveX Script

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


Discuss DayOfWeek - Determining in ActiveX Script in the microsoft.public.sqlserver.dts forum.



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

Default DayOfWeek - Determining in ActiveX Script - 05-24-2004 , 03:21 PM






I'm very new to writing DTS Packages. However, I have one where I want it to execute a certain package if the DayOfWeek = 1 (Monday), otherwise, I want it to do something else. I'm having trouble trying to get my ActiveX Script to recognize the 1 for Monday.

I'm guessing that I'm missing setting it up as a global variable or setting it or something? Looking for any suggestion you might have. This is the line I'm trying to use..

If DayOfWeek = '1' The


Reply With Quote
  #2  
Old   
Ashish Ruparel [MSFT]
 
Posts: n/a

Default RE: DayOfWeek - Determining in ActiveX Script - 05-24-2004 , 09:42 PM






Hi,

If you want the script to check for the dayofweek for the date that it is
executed on, then
use the datepart function

if datepart(w,now())=vbMonday then

end if

If you want the script to check it against a global variable then

Declare the variable of type Integer
and then compare it
for eg

DayOfWeek int

if Dayofweek = vbMonday then

end if


vbMonday is a constant that is used with VBScripting

for more information on datepart function, visit
http://msdn.microsoft.com/library/de...us/script56/ht
ml/vsfctdatepart.asp?frame=true

HTH
Ashish
This posting is provided "AS IS" with no warranties, and confers no rights.


Reply With Quote
  #3  
Old   
L Hacic
 
Posts: n/a

Default RE: DayOfWeek - Determining in ActiveX Script - 05-25-2004 , 09:27 AM





Thank you very much for your suggestion. I gave it a try and it worked!

Since this was my very first DT Pkg and ActiveX Script, you made my day!

Lynn

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

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.