Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove Time from DTPicker

Status
Not open for further replies.
Feb 6, 2006
5
GB
Hi all,

I need to remove the time input from the DTPicker. i am using it as part of a data entry form and added it sometime after i created the form.

However, i now find that for any entries which were made using the DTPicker, the queries I run on the entered data does not pick up the entries made by the DTPicker because of the date format.

Is there anyway to remove the time? Or is there a way to design the query so it picks up entries made with the DTPicker?

help much appreciated.

regards

Keji
 
[tt]DateValue()[/tt]? This will strip off the time portion of a DateTime value.

CMP

(GMT-07:00) Mountain Time (US & Canada)
 
How are ya matakulous . . .

Have you tried setting a [blue]custom format?[/blue]

Calvin.gif
See Ya! . . . . . .
 
Hi there,

thanks for responding, im still very novice at this, so i wasn't sure where to put the DateValue function

This is what my SQL for the query looked like beforehand:

PARAMETERS [Forms]![frmChooseDTDate]![DateOccured] DateTime;
SELECT Downtimes.DateOccured, Downtimes.ShiftID, Downtimes.LineID, Downtimes.MachineID, Downtimes.MaterialCode, Downtimes.DTCategoryID, Downtimes.HoursLost, Downtimes.DTReasonID, Downtimes.CorrectiveActionID
FROM Downtimes
WHERE (((Downtimes.DateOccured)=[Forms]![frmChooseDTDate]![DateOccured]));

I then put the DateValue function in the 'WHERE' statement like so:

WHERE (((Downtimes.DateOccured)=[Forms]![frmChooseDTDate]!DateValue([DateOccured])));

However, I then got an error message which said:

Undefined function '[Forms]![frmChooseDTDate]!DateValue' in expression

im quite stuck, any ideas?

regards to all

 
In this instance [tt][Forms]![frmChooseDTDate]![DateOccured][/tt] is the field, so you would feed it to [tt]DateValue()[/tt] like:

[tt]WHERE (((Downtimes.DateOccured)=DateValue([Forms]![frmChooseDTDate]![DateOccured])))[/tt]

CMP

(GMT-07:00) Mountain Time (US & Canada)
 
You may also try this:
WHERE Int(DateOccured)=Int([Forms]![frmChooseDTDate]![DateOccured]);



Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top