Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 27th, 2008, 12:27 PM
Registered User
 
Join Date: May 2008
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help required for data entry format

How do i change the data format of a column of a table?
I need to show an error message if data in date of birth textbox is entered incorrectly, need to specify the format as well. Will it be done through database or visual studio? How?
Reply With Quote
  #2 (permalink)  
Old May 27th, 2008, 01:58 PM
Friend of Wrox
Points: 2,101, Level: 18
Points: 2,101, Level: 18 Points: 2,101, Level: 18 Points: 2,101, Level: 18
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2003
Location: , , .
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default

You can run a function on your value that runs a regular expression on the date entered.

This returns a boolean value. Throw an error if the date does not pass the test. Write your error to a label, "Please enter date as mm/dd/yyyy."

    Function CheckDate(ByVal Value As String) As Boolean
        Dim ex As Regex = New Regex("([1-9]|1[012])[- /.]([1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d")
        Return ex.Match(Value).Success
    End Function

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
help required to change format when converted from tdnithin Excel VBA 2 September 25th, 2008 01:01 AM
Transforming data in required XML Format pvasudevan XSLT 6 September 6th, 2006 02:34 AM
Data Entry from Repeater m_t_clayton ASP.NET 2.0 Professional 0 March 20th, 2006 06:13 PM
Data entry from email SiliconFuRy PHP Databases 4 December 17th, 2004 09:40 AM
error in data entry vickyj SQL Server 2000 6 September 13th, 2004 10:02 AM



All times are GMT -4. The time now is 04:39 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.