Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

date field on forms

 
   Database Help (Home) -> MS Access RSS
Next:  Exit A Database In Order To Go To Design View  
Author Message
George Applegate

External


Since: Apr 18, 2008
Posts: 25



(Msg. 1) Posted: Sat Dec 27, 2008 9:10 am
Post subject: date field on forms
Archived from groups: microsoft>public>access (more info?)

I am having a problem with dates stored as text and also on forms.

First, some background:

I have some queries that include only certain records based on a date
range of records:

I have a DATEWORK table that has a begin date and and end date in DATE
format. Now, I have some records in an PAYLOG table that are
populated automatically from a time-clock in mm/dd/yyyy format, but
they are TEXT and I cannot change that. I have to live with that.

I have some queries that I use to select records in the PAYLOG based
on the begin date and end date in the DATEWORK table. I got that to
work fine by creating a work field in my query as Datevalue([logdate])
and then > begindate and < enddate. The datevalue puts the text
version of the date into a true date so it selects based on the range
- which is a problem when it goes from 12/29/2008 to 01/05/2009, if
that make sense.

PROBLEM:
However, now I've run into a problem with forms. I have a form that I
allow the user to enter a "start date" and "end date" for the range.
The problem is, I think that is a "text date" also, since it's in a
text box??? For instance, if the user enters "12/28/2008" and
"01/05/2008", on the form, it doesn't seem to work. How do I change
the FORM start date and end date to be considered DATE Fields, or is
that possible.

Once they are date fields, then I can use the datevalue([logdate]) and
I would say the logdate has to be > form!startdate and <
form!enddate???

Any suggestions or ideas?

Thanks,
ga

George Applegate
gappleg8.DeleteThis@nospam.fmctc

 >> Stay informed about: date field on forms 
Back to top
Login to vote
Rick Brandt

External


Since: Nov 17, 2008
Posts: 66



(Msg. 2) Posted: Sat Dec 27, 2008 10:25 am
Post subject: Re: date field on forms [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Sat, 27 Dec 2008 09:10:05 -0600, George Applegate wrote:

> I am having a problem with dates stored as text and also on forms.
>
> First, some background:
>
> I have some queries that include only certain records based on a date
> range of records:
>
> I have a DATEWORK table that has a begin date and and end date in DATE
> format. Now, I have some records in an PAYLOG table that are populated
> automatically from a time-clock in mm/dd/yyyy format, but they are TEXT
> and I cannot change that. I have to live with that.
>
> I have some queries that I use to select records in the PAYLOG based on
> the begin date and end date in the DATEWORK table. I got that to work
> fine by creating a work field in my query as Datevalue([logdate]) and
> then > begindate and < enddate. The datevalue puts the text version of
> the date into a true date so it selects based on the range - which is a
> problem when it goes from 12/29/2008 to 01/05/2009, if that make sense.
>
> PROBLEM:
> However, now I've run into a problem with forms. I have a form that I
> allow the user to enter a "start date" and "end date" for the range. The
> problem is, I think that is a "text date" also, since it's in a text
> box??? For instance, if the user enters "12/28/2008" and "01/05/2008",
> on the form, it doesn't seem to work. How do I change the FORM start
> date and end date to be considered DATE Fields, or is that possible.
>
> Once they are date fields, then I can use the datevalue([logdate]) and I
> would say the logdate has to be > form!startdate and < form!enddate???
>
> Any suggestions or ideas?

By default an Access query will make a "best guess" as to the DataType of
parameters. You can however, open the parameters dialog while in query
design view and explicitly indicate the DataTypes. In your case you need
to set the form reference parameters to DateTime.


--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com

 >> Stay informed about: date field on forms 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Limit date field to only allow current date or past dates - I would like to limit a data field in a table to only allow the current date or past dates as we are tracking the date when something was completed...so I want to limit the date so it does not allow future dates. Thanks, ERic

auto Date on forms - I woul like a way for every time i add a new customer to my database that the date it was entered is stored. How do i do this so that it does not change if i ever edit the recored Thanks Simon

Is there a date dropdown object i can use in my forms. - Hi, i have a form that requires the user to enter a date.. i know ive seen a dropdown box (similar to a combo box) with a calendar that you can select the day very easily without having to type it. Can anyone help? Thanks

MS Qry and text field to date field - I am using MS Query to pull files (from IBM AS400) and put them in Excel. However, when I do this the dates are now text fields. The text/ Date field looks like this: 20070331 (YYYYMMDD) I would like the change this text to a date field so Excel will....

convert number field with year value to date field - Is it possible to convert a number field containing years (possitive and negative) to a date field. It does not matter if they turn out all being the 1st of january. I just have an historical database with the year values bc and ad stored as negative....
   Database Help (Home) -> MS Access All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]