[thelist] Date Masking in SQL Server 2k?

Ken Schaefer ken at adOpenStatic.com
Fri Oct 3 23:01:36 CDT 2003


You can supply a default date in SQL Server by editing the table properties
(eg in Enterprise Manager), and adding GetDate() as the default -> this is
equivalent (roughly) to Access's inbuild VBA Date() function which you can
use to supply today's date as default value.

If you're using some kind of Access form to enter this data (rather than
typing directly into the table), then I assume you'd need to program Date()
as the default value in the form, or write some code so that if the user
leaves it blank, then nothing is sent to SQL Server for that field (so that
SQL Server supplies the default date).

HTH

Cheers
Ken

Microsoft MVP - Windows Server (IIS)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Rob Smith" <rob.smith at THERMON.com>
Subject: RE: [thelist] Date Masking in SQL Server 2k?


: Hi Ken,
:
: A colleague of mine is trying to supply an Input mask for "Today's" date
in
: a particular form in efforts to elevate one more key stroke for the end
: user.
:
: i.e.
:
: Part Number: (user filled)
: Date: (auto filled)  <--------
: Invoiced: (user filled)
: < ok > < cancel >
:
: ... in Access 97. The original format used an input mask with access and
was
: a data type default if you will in "this" table. Now that the tables are
: linked tables, with Access serving as a front end, that option has
vanished.
: Just looking for another way to keep that input mask available.



More information about the thelist mailing list