Date Fields Question

I

iam

I there any way to set a date field to allow incomplete dates?

Most of the dates I have would have a format like:

10-25-2004

But sometimes It could be missing information.

10-??-2004

??-25-2004

??-25-????

etc.......

I've tried using spaces, question marks, and exclamations to no avail.

I want to be able to sort on this field and to query on this field so
I hesitate to make it a non-date field. Is that my only choice?
To make it a straight Alphanumeric field?
 
R

Rebecca Riordan

No, you'll need to use three separate fields. But this can actually make
life easier, because it gives you more options in the UI.

HTH

--
Rebecca Riordan, MVP

Seeing Data: Designing User Interfaces
Designing Relational Database Systems, 2nd Edition
www.awprofessional.com

Microsoft SQL Server 2000 Programming Step by Step
Microsoft ADO.NET Step by Step
www.microsoft.com/mspress
 
I

iam

For what I want to do, separating the date to the three fields will
complicate the hell out of what otherwise is a
very simple ten field database and report.

Sigh......
 
J

John Vinson

I there any way to set a date field to allow incomplete dates?

Most of the dates I have would have a format like:

10-25-2004

But sometimes It could be missing information.

10-??-2004

??-25-2004

??-25-????

etc.......

I've tried using spaces, question marks, and exclamations to no avail.

As Rebecca says, no you cannot. A Date/Time value IS NOT A STRING.
It's stored internally as a double float number, a count of days and
fractions of a day (times) since midnight, December 30, 1899. As such
any date/time value corresponds to one precise moment of time.

You'll need to use a text field. Searching it will be complicated I
fear (but you're asking this field to do a complicated job!)
 
I

iam

Yeah, I get the jist of what has to be done.

I don't know about you folks but I have had enough of Microsofts lousy
products.
 
R

Rebecca Riordan

Has nothing to do with Microsoft. This is how relational databases work.

--
Rebecca Riordan, MVP

Seeing Data: Designing User Interfaces
Designing Relational Database Systems, 2nd Edition
www.awprofessional.com

Microsoft SQL Server 2000 Programming Step by Step
Microsoft ADO.NET Step by Step
www.microsoft.com/mspress
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top