Re: HELP with DateAdd statement and SQL
From: Bob Barrows (reb01501_at_NOyahoo.SPAMcom)
Date: 03/01/04
- Next message: Giuseppe Cibrario: "Re: How to register a NT client on a 2000 Dynamic DNS via script"
- Previous message: Jonathan Orlev: "Re: An interesting small WSH VBScript problem: CreateObject fails to terminate (stack) when logged out from the server"
- In reply to: robnson: "HELP with DateAdd statement and SQL"
- Next in thread: robnson: "Re: HELP with DateAdd statement and SQL"
- Reply: robnson: "Re: HELP with DateAdd statement and SQL"
- Reply: robnson: "Re: HELP with DateAdd statement and SQL"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 1 Mar 2004 04:57:10 -0500
robnson wrote:
> I am trying to pull the date from the day before "objDate =
> DateAdd("d", -1, Date)" in standard time format, and I am wanting to
> convert it into UTC time "dtmCurrentDate = "&objDate&" " then pass it
> into a SQL command " "WHERE [Type]='error' AND
> [TimeWritten]>'&dtmTargetDate&' ". The script works however it isn't
> passing the date and coverting into UTC. Can someone please help me
> with this? Below you will find my script.
>
What is the datatype of the TimeWritten column? If it is datetime, you are
making a mistake by passing the the time in UTC format.
> Conn.Open = "provider=sqloledb;data source=SCK-EAV-01;" & _
> "user id=sa;password=justD0!t;" & _
Gasp! You have two major security problems here:
1. Using the sa account for applications is a major gaffe. You should create
a login with the minimum permissions required to perform the tasks required
for your application and use that account.
2. The first gaffe is relatively minor compared to this one: You just
revealed your server's sa password to the internet!!! Protect your server's
sa account as if your job depended on it (it probably does). Go change that
password now!
Bob Barrows
-- Microsoft MVP - ASP/ASP.NET Please reply to the newsgroup. This email account is my spam trap so I don't check it very often. If you must reply off-line, then remove the "NO SPAM"
- Next message: Giuseppe Cibrario: "Re: How to register a NT client on a 2000 Dynamic DNS via script"
- Previous message: Jonathan Orlev: "Re: An interesting small WSH VBScript problem: CreateObject fails to terminate (stack) when logged out from the server"
- In reply to: robnson: "HELP with DateAdd statement and SQL"
- Next in thread: robnson: "Re: HELP with DateAdd statement and SQL"
- Reply: robnson: "Re: HELP with DateAdd statement and SQL"
- Reply: robnson: "Re: HELP with DateAdd statement and SQL"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|