Ask a Question related to ASP Database, Design and Development.
-
Darren Woodbrey #1
Date text Field
I have an asp form that is submitted to sql server 2000. There are three
date fields. How can I allow the user to enter the date without any
seperators i.e. mmddyyyy, 07152004. I have seen forms on the web that
allows you to do adding the - as you go. I have tried just entering
07152004, but the sql server does not like this - type mismatch. The field
is a datetime.
Thanks!
Darren
Darren Woodbrey Guest
-
Changing to British date form a US style (text) field
Hello all I have a document tracking database set up in FM Pro. One of the fields I use is a "Due Date" field which is scripted to add two days... -
Date comparison in a text data field
I have a database column field defined as a text. I store dates in format: dd/mm/yyyy. The user passes a Start date search string in the same... -
Converting a text field to a date field - FM6
I need to convert a Text field containing both auto and manually entered dates over to a Date field. The records that were autoentered move over... -
Linking date field to text field entry
Is there a way to setup a date field that will automatically enter the date when any information is entered into a field next to it? -
date in text field
How can I include a date that is formatted in the following structure 9-July-03, and include it in a form text field? The form input code is:... -
Ray at #2
Re: Date text Field
You'll have to deal with the user input if you want to give them freedom to
enter dates at they like. Just be sure you deal with dates like 1/12/2004
vs. 11/2/2004, and things like that.
The format of the date when you insert it into SQL should ideally look like:
2004-07-15
So, it's just some string manipulation to take 07152004 and turn it into
2004-07-15. If you're not sure how to go about that, post back.
Ray at home
"Darren Woodbrey" <darrenwoodbrey@hpfairfield.com> wrote in message
news:O1TTWgqaEHA.1644@tk2msftngp13.phx.gbl...field> I have an asp form that is submitted to sql server 2000. There are three
> date fields. How can I allow the user to enter the date without any
> seperators i.e. mmddyyyy, 07152004. I have seen forms on the web that
> allows you to do adding the - as you go. I have tried just entering
> 07152004, but the sql server does not like this - type mismatch. The> is a datetime.
>
> Thanks!
> Darren
>
>
Ray at Guest
-
Aaron [SQL Server MVP] #3
Re: Date text Field
> 2004-07-15
That format is fine for Access. The only safe format for SQL Server is
20040715 (which doesn't work in Access, unfortunately).
Try this repro in SQL Server:
SET LANGUAGE ENGLISH
GO
SELECT DATEADD(DAY, 1, '2004-07-05')
GO
SELECT DATEADD(DAY, 1, '2004-07-15')
GO
SELECT DATEADD(DAY, 1, '20040715')
GO
SET LANGUAGE FRENCH
GO
SELECT DATEADD(DAY, 1, '2004-07-05')
GO
SELECT DATEADD(DAY, 1, '2004-07-15')
GO
SELECT DATEADD(DAY, 1, '20040715')
GO
SET LANGUAGE ENGLISH
Aaron [SQL Server MVP] Guest



Reply With Quote

