473,320 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Help on Date format ???

Dear all,

I have a web application build with ASP 1.1 which has a querry form based on
fields where users need to enter a date/time value for data collection.

On my Web server the date time foprmat is set with US (english).

The final querry will be something like :
" select * from Table 1 where DATE_TIME > @DateTimeParam"

What is the way to control that the value enter in the DAte/tiome tex box
correspond to proper date format and will return correct information based on
server date/time format ?

For example if I pass the date in MM/dd/yyyy and my server is set o use
dd/MM/yyyy, then if you enter 2/3/2006 or its interprated on the server as
3/2/2006 I will not have correct data.

How can I check that ??

Thanks for your help
regards

Serge
Apr 4 '06 #1
2 1096
You can't really. If they type in a valid date, then you haven't any
way of telling what the user was thinking at the time. This assumes the
user was thinking.

If you want to avoid the problem you can use either a date/time picker
control, or the old fashioned way, separate dropdownlists for
Day/Month/Year.

Or you can always refuse any format except yyyy-mm-dd, but your users
will think you're crazy.

Apr 4 '06 #2
I just built an application where the date they entered was a very
important piece of info for the account. It was for escrow/home buying.
The date entered was a close of escrow date and many people relied on
it. There were also certain guide lines to it. It couldn't be more than
60 days old, and it couldn't be a future date.

I ran into the same situation as you when I used a single textbox
relying on the user entering in a correct date. I finally found it was
easier to populate 3 drop downs with the appropriate data. Now it works
great. First they have to select the month, then based on the month
selection it fills the day selection with the appropriate amount of
days for that month, example: 31 for January, 28 for February (29 on a
leap year), etc. That way you will ALWAYS get a valid date in the same
format as you expect it in.

Hope it helps,
Jeremy Reid
http://hgtit.com

Apr 4 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: cg_news | last post by:
In short, what I am trying to do is, based on a date, calculate the week of year (as described in ISO 8601), then calculate the first and last date in this week period and return them in the format...
2
by: nadmasl | last post by:
I have an MS Access form, where a user enters the date by selecting it from three combo boxes for day, month and year. I convert it to 11-Jan-2004 format and attempt to write to the table with an...
3
by: Alicia | last post by:
Hi, I am trying to match two queries and make it into one query. I have only been about to group similar attributes but nothing that looks like the FinalQuery below. If anyone knows of a query...
5
by: Alicia | last post by:
Hello everyone based on the data, I created a union query which produces this. SELECT ,,, 0 As ClosedCount FROM UNION SELECT ,, 0 AS OpenedCount, FROM ORDER BY , ;
6
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing...
2
by: Bill | last post by:
I have a 200 record database that includes a date/time field, AnnivDate, for a wedding anniversary. AnnivDate has nulls and some incorrect year data. I have been creating the Access database...
9
by: pic078 via AccessMonster.com | last post by:
I need serious help - I have a frontend/backend Access database (2 MDE Files) that remains stuck in task manager after exiting the application - you can't reopen database after exiting as a result...
8
by: saladinator | last post by:
I have created an Excel spreadsheet that has a lot of data. What I want to do is import the spreedsheet to Access and create a form so that I can print each row per page in a proffessional manner....
2
matrekz42
by: matrekz42 | last post by:
Hello friends, I'm trying to run this Dynamic SQL in VB, but I keep getting "Compile Error" Syntax Error, in the "Bolded" area. I'm only trying to change these fields for the second query listed,...
5
by: jrod11 | last post by:
hi, I found a jquery html table sorting code i have implemented. I am trying to figure out how to edit how many colums there are, but every time i remove code that I think controls how many colums...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.