Ask a Question related to ASP, Design and Development.
-
Greg Wiskotter #1
Convert date/time to date in SQL Server 2000 statement
Can this be done?
tia
Greg Wiskotter Guest
-
How to get FMS server time and date
hi, i m working on a customer support chat application. There is neccssary for me to get the FMS server time and date, bcoz depending on the server... -
CFMX7.0.1 Administrator date time issue showing 13hrsbehind server time
I am running a W2k SP4 box that has been upgraded from CFMX6 to CFMX7.0.1. The CFMX7.0.1 server is showing the date on the Server Settings >... -
date/time field from access 2000 db getting -1 in textbox on form
I am stuck in using Access 2000 with on Windows 2000 server. I get a negitive 1 for a value. My code $DB_Conn = new... -
Exception error with date/time (Access 2000)
I am picking up a strange exception error for the following statement: If Rs.EOF OR DATEDIFF("d",rs("DateTime"),NOW()) Then '// End If Is... -
ASP SQL Server 2000 Date/Time Formating
Hello, I have two questions which I would appreciate some help with. 1. Date Formating when Inserting into SQL Server 2000 I'm currently... -
Aaron Bertrand - MVP #2
Re: Convert date/time to date in SQL Server 2000 statement
Yes, can you show an example of what you are looking for? Maybe:
SELECT CONVERT(CHAR(8), GETDATE(), 112)
"Greg Wiskotter" <dsfdfsdfdfsdfsdfwe@sdfsdfsdf34234sdfsd.com> wrote in
message news:#cIASv0lDHA.1672@TK2MSFTNGP09.phx.gbl...> Can this be done?
>
> tia
>
>
>
Aaron Bertrand - MVP Guest
-
Don Grover #3
Re: Convert date/time to date in SQL Server 2000 statement
<%
'This function recieves a date from text string in format dd/mm/yy or
dd/mm/ccyy
'And creates a string that is compatible with inserting into sql as a
datetime field
'If an empty string is passed it just passes back trimmed original
'Write Value Test value to sql database 'datetime' field
'Added 16/04/2003
'If a 2 digit year is passed then 20 is prepended onto year to build a CCYY
year
'---------
'sValues = " NULLIF('" & convdate(sDate) & "','')"
'---------
'pass a date as dd/mm/yy
Function convDate(theDate)
Dim Itemp
If TRIM(theDate) <> "" Then
sTemp = cdate(theDate)
dteArray = Split(sTemp,"/",-1,1)
If LenB(dteArray(2)) = 2 Then
dteArray(2) = "20" & dteArray(2)
End If
convDate =dteArray(2) & "/" & dteArray(1) & "/" & dteArray(0)
Else
convDate = Trim(theDate)
End If
End Function
%>
"Greg Wiskotter" <dsfdfsdfdfsdfsdfwe@sdfsdfsdf34234sdfsd.com> wrote in
message news:%23cIASv0lDHA.1672@TK2MSFTNGP09.phx.gbl...> Can this be done?
>
> tia
>
>
>
Don Grover Guest
-
Jeff Cochran #4
Re: Convert date/time to date in SQL Server 2000 statement
On Mon, 20 Oct 2003 13:50:41 -0700, "Greg Wiskotter"
<dsfdfsdfdfsdfsdfwe@sdfsdfsdf34234sdfsd.com> wrote:
FWIW, I prefer to handle the display of the date/time in the VBScript>Can this be done?
instead of the query. I don't know that there's any difference in
performance or utility, it just seems cleaner to me to handle the
presentation in the ASP code rather than the query. This assumes a
date/time field in your database and the date isn't simply stored in a
text field. Though that can work too.
When I do need to do a date/time SELECT, I like Aaron's method if it
fits your needs.
Jeff
Jeff Cochran Guest



Reply With Quote

