Getting today's date..... 
Author Message
 Getting today's date.....

Normally, getting today's date as a default value is easy...but the person
that created this access97 db, thoughtlessly named a key field [date]...now
when i try to use the date function it returns the values of that field, not
the current time.  Any one have a function or a way to get today's date in
m/d/yyyy format without using "Date"?  I tried converting now()'s value
(long time and date) but had no luck.   Any advice or help would be
appreciated.

Thank you so much for your time and help
Bill



Tue, 11 Mar 2003 03:00:00 GMT  
 Getting today's date.....
format(now(),"m/d/yyyy")   did not work ?
or
format(now(),"mm/dd/yyyy")

On Fri, 22 Sep 2000 16:29:53 -0700, "Bill Brinkworth"

Quote:

>Normally, getting today's date as a default value is easy...but the person
>that created this access97 db, thoughtlessly named a key field [date]...now
>when i try to use the date function it returns the values of that field, not
>the current time.  Any one have a function or a way to get today's date in
>m/d/yyyy format without using "Date"?  I tried converting now()'s value
>(long time and date) but had no luck.   Any advice or help would be
>appreciated.

>Thank you so much for your time and help
>Bill



Tue, 11 Mar 2003 03:00:00 GMT  
 Getting today's date.....
Bill,

Use

                CDate(Int(Now()))

This truncates the time from the Now() value (Access stores dates as a
floating point number, where date 0.0 is midnight on 12/30/1899). So the
integer part of a date value is the number of days before or after
12/30/1899, and the fractional part is that fraction of a day passed since

12/30/1899.

In the nested functions above, Now() returns today's date AND time,
Int(Now()) strips the time from the floating point value, leaving only the
"date", and CDate() converts the integer result into a Date data type. Note
that if you're storing this into a Date/Time type field, or assigning it to
a Date type variable, then the CDate() isn't really needed since VBA will do
the type conversion for you.

The proper solution would be, of course, to change the name of the offending
field--however I know what an arduous process that can be--I have always
been annoyed that Access continues to permit naming database objects the
same as VBA keywords. In v1.0 this was OK as there was no VBA, everything
had to be done with macros. I guess that for backward compatibility they
have continued to allow it.

Hope this helps...


Quote:
> Normally, getting today's date as a default value is easy...but the person
> that created this access97 db, thoughtlessly named a key field
[date]...now
> when i try to use the date function it returns the values of that field,
not
> the current time.  Any one have a function or a way to get today's date in
> m/d/yyyy format without using "Date"?  I tried converting now()'s value
> (long time and date) but had no luck.   Any advice or help would be
> appreciated.

> Thank you so much for your time and help
> Bill



Wed, 12 Mar 2003 03:00:00 GMT  
 Getting today's date.....

Bill,
I use Speed Ferret for just such occasions.
You can do a global search and replace in your db.
Check out http://www.moshannon.com/speedferret.html

--
Hope This Helps,
Jeff Davies

Quote:

> Normally, getting today's date as a default value is easy...but the person
> that created this access97 db, thoughtlessly named a key field [date]...now
> when i try to use the date function it returns the values of that field, not
> the current time.  Any one have a function or a way to get today's date in
> m/d/yyyy format without using "Date"?  I tried converting now()'s value
> (long time and date) but had no luck.   Any advice or help would be
> appreciated.

> Thank you so much for your time and help
> Bill



Fri, 14 Mar 2003 09:58:43 GMT  
 Getting today's date.....
Format(Now(), "m/d/yyyy") Should work

Steve King


Quote:
> Normally, getting today's date as a default value is easy...but the person
> that created this access97 db, thoughtlessly named a key field
[date]...now
> when i try to use the date function it returns the values of that field,
not
> the current time.  Any one have a function or a way to get today's date in
> m/d/yyyy format without using "Date"?  I tried converting now()'s value
> (long time and date) but had no luck.   Any advice or help would be
> appreciated.

> Thank you so much for your time and help
> Bill



Fri, 14 Mar 2003 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. getting today's date

2. Selecting Today's Date With Sheridan Date Combo

3. Adding a variable number of weeks to today's date

4. Returning today's date

5. Accessing today's date in a filter

6. Inserting today's date

7. Today's Date

8. Viewing today's date

9. Automatically selecting *today's* date - MonthView control

10. Date time picker has today's value

11. How to subtract a value from today's date

12. Filter on Today's Date

 

 
Powered by phpBB® Forum Software