UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> How To Validate Varchar Field For Yyymmdd, classic    
 
   
smyeong
post Jun 11 2018, 04:42 AM
Post#1



Posts: 397
Joined: 6-November 02
From: Malaysia


Hi,there. I would like to enquire if i could write a vbscript or javascript that is to verify a varchar field so that it must fit this format YYYY/MM/DD? My page is coded in asp classic.

field :trdate varchar On the page, it was indicated with a remark yyyy/mm/dd..see attached

TQ

Attached File(s)
Attached File  Untitled.png ( 5.28K )Number of downloads: 0
Attached File  Untitled.png ( 5.28K )Number of downloads: 0
 

--------------------
We should see thing in both side. positive and negative
Pls visit http://ipohtech.blogspot.com for tech solutions around the world..
Malaysia.
Go to the top of the page
 
DanielPineault
post Jun 11 2018, 11:33 AM
Post#2


UtterAccess VIP
Posts: 5,950
Joined: 30-June 11



See: https://stackoverflow.com/questions/1875877...dd-using-jquery

Your RegEx might be more like:

\d{4}[/](0?[1-9]|1[0-2])[/](0?[1-9]|[12][0-9]|3[01])




Why not use a date picker?
Why not use a Date/Time data type?





--------------------
Daniel Pineault (2010-2017 Microsoft MVP)
Professional Help: http://www.cardaconsultants.com
Free MS Access Code, Tips, Tricks and Samples: http://www.devhut.net

* Design should never say "Look at me". It should always say "Look at this". -- David Craib
* A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc


All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions)
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    20th June 2018 - 01:41 PM