Home
Forums
New posts
Search forums
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
C# Community
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Home
Forums
Database
Database General Discussion
VB Scripts
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="eNerGiZer1010" data-source="post: 740" data-attributes="member: 413"><p>G'Day Folks,</p><p></p><p>I have a script that I want to use with SQL Server. What I want the script to do is run a query in in sql for the current date time as star date time and current date time -24 hours for end date time. The script is supposed to run daily reports taking bd for the past 24 hours. </p><p></p><p>My problem is that i'm not sure what to write in the script to set the start date time as (windows current time) and the end date time as (windows current time - 24 hours).</p><p></p><p>Here is the script:</p><p>if StartDateTime = "" then</p><p> Prompt1 = "Enter the start date for the report." & vbcrlf & "Format: yyyy-mm-dd HH:mm:ss"</p><p> StartDateTime = InputBox(Prompt1,"Report Start Date" , DefaultStartDateTime)</p><p> if len(startDateTime) = 0 then</p><p> 'User click on Cancel</p><p> Wscript.Echo "Report Generation has been cancelled."</p><p> Wscript.Quit</p><p> End If</p><p>end if</p><p></p><p>if EndDateTime = "" then</p><p> Prompt2 = "Enter the End date for the report." & vbcrlf & "Format: yyyy-mm-dd HH:mm:ss"</p><p> EndDateTime = InputBox(Prompt2,"Report End Date" , DefaultEndDateTime)</p><p> if len(EndDateTime) = 0 then</p><p> 'User click on Cancel</p><p> Wscript.Echo "Report Generation has been cancelled."</p><p> Wscript.Quit</p><p> End If</p><p>end if</p><p></p><p></p><p>From my understanding I will need to write a function so that start date time = windows current date time and that end date time = windows current date time - 24 hours. </p><p></p><p>P.S. Is the format of the date time in windows the same as the format of the script because that could be a problem?</p><p></p><p>Thanks for all the help.</p><p></p><p>Your's truly.</p></blockquote><p></p>
[QUOTE="eNerGiZer1010, post: 740, member: 413"] G'Day Folks, I have a script that I want to use with SQL Server. What I want the script to do is run a query in in sql for the current date time as star date time and current date time -24 hours for end date time. The script is supposed to run daily reports taking bd for the past 24 hours. My problem is that i'm not sure what to write in the script to set the start date time as (windows current time) and the end date time as (windows current time - 24 hours). Here is the script: if StartDateTime = "" then Prompt1 = "Enter the start date for the report." & vbcrlf & "Format: yyyy-mm-dd HH:mm:ss" StartDateTime = InputBox(Prompt1,"Report Start Date" , DefaultStartDateTime) if len(startDateTime) = 0 then 'User click on Cancel Wscript.Echo "Report Generation has been cancelled." Wscript.Quit End If end if if EndDateTime = "" then Prompt2 = "Enter the End date for the report." & vbcrlf & "Format: yyyy-mm-dd HH:mm:ss" EndDateTime = InputBox(Prompt2,"Report End Date" , DefaultEndDateTime) if len(EndDateTime) = 0 then 'User click on Cancel Wscript.Echo "Report Generation has been cancelled." Wscript.Quit End If end if From my understanding I will need to write a function so that start date time = windows current date time and that end date time = windows current date time - 24 hours. P.S. Is the format of the date time in windows the same as the format of the script because that could be a problem? Thanks for all the help. Your's truly. [/QUOTE]
Insert quotes…
Verification
Post reply
Home
Forums
Database
Database General Discussion
VB Scripts
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top
Bottom