Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 27th, 2008, 12:27 PM
Registered User
 
Join Date: May 2008
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?
 
Old May 27th, 2008, 01:58 PM
Friend of Wrox
 
Join Date: Jul 2003
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






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





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