Dorian:
I hate to pick on you, but you opened the door to a pet peeve of mine.
I don't think it's good ettiquete to ever answer a newsgroup post of
any kind with the suggestion, "Look it up in the help file"
There was a time when help files were useful, but those days ended
about 4 years ago. Now, search SQL Server On Line Books for
something like CHARINDEX and you get millions of bits of information,
but nothing useful or useable.
The same is more-or-less true of Access help system. I still keep a
copy of Access 97 around, just so I can access the help file to get a
direct answer to my questions.
But even if that wasn't true, it should be assumed that people who post
to newsgroups are looking for something more than the cold, impersonal
and sometimes incomplete information they can find in a help file.
Whew. Feels good to get that off my chest. And FWIW, it's not something
I've seen in the Access newsgroups so much. It's more in the SQL Server
group. Someone will ask something like ...
"How do I format a date in SQL Server as YYYY-MM-DD?"
Someone will then reply, read the help file under CONVERT(). The help
file text for the CONVERT() method sucks. Actually, the help file sucks
because SQL Server sucks when it comes to handling dates. (Sorry
Aaron, but if you can't admit that, then we know you have blinders on.)
The Access Format() function still a dream for SQL Server.
There's a trick to that little date format, something not mentioned in the
help file. No one on the SQL Server newsgroups ever helped me with
it and it wasn't until I'd been using SQL Server for 7 years before I learnt it.
BTW, the SQL Server trick I'm speaking of is that date formats only work
if/when you convert them to strings. The top 3 SQL calls below all return
the same output. The bottom two give you different formats. Of course,
those calls won't give you any custom formats, like YYYYMMDD without
punctuation. You'll have to add function calls for that, and if you want single
digit month and day to be padded with zeros then you need an army of
functions.
SELECT GETDATE()
SELECT CONVERT(DATETIME, GETDATE(), 101)
SELECT CONVERT(DATETIME, GETDATE(), 1)
SELECT CONVERT(VARCHAR(11), GETDATE(), 101)
SELECT CONVERT(VARCHAR(11), GETDATE(), 1)
Sometimes, it's not enough to read the help files. That's why people support
newsgroups like this one.