Re: date and time syntax
From: Ken Snell (kthsneisllis9_at_ncoomcastt.renaetl)
Date: 06/20/04
- Next message: John Vinson: "Re: Export Data from Subform"
- Previous message: MacDermott: "Re: Changing color schemes on the fly"
- In reply to: smk23: "date and time syntax"
- Next in thread: smk23: "Re: date and time syntax"
- Reply: smk23: "Re: date and time syntax"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 19 Jun 2004 20:06:44 -0400
You can add a date to a time by delimiting the date value with # and then
adding to the time that was entered:
Me.somefield = #1/1/1990# + Me.ApptTime
--
Ken Snell
<MS ACCESS MVP>
"smk23" <smk23@discussions.microsoft.com> wrote in message
news:5BC7DF40-C4F0-4860-A286-33B6B4E621C2@microsoft.com...
> Greetings all!
> I have a time field that holds appointment time. Typically the user will
only enter the time. My BE is SQL server 2k and the data type is
smalldatetime for this column.
> The FE is Access 2002. The date default Access enters if there is no date
specified is 12/31/1899 which is out of the date range for smalldatetime and
an error is generated.
>
> One way to solve this is to add a couple of days on an AfterUpdate event
when the user enters a time. This has problems because the time field will
not sort correctly if there are a variety of dates preceding the time.
Rather than allow Access to insert a default date, it seems that the best
way to resolve this is to enter my own date.
>
> I tried the following syntax ideas:
> Me.somefield= CDate("1/1/1990 " & Me.ApptTime)
> or
> Me.somefield = Me.ApptDate & Me.ApptTime
>
> I get an "wrong data type" error with both.
> How have others addressed this issue? Apparently MS Access 2003 has
corrected this, but I don't have the ability to update right now.
>
> --
> sam
- Next message: John Vinson: "Re: Export Data from Subform"
- Previous message: MacDermott: "Re: Changing color schemes on the fly"
- In reply to: smk23: "date and time syntax"
- Next in thread: smk23: "Re: date and time syntax"
- Reply: smk23: "Re: date and time syntax"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|