How to fix a Field with a Date Mix
-
- 2StarLounger
- Posts: 119
- Joined: 01 Jul 2013, 14:08
How to fix a Field with a Date Mix
I have a table with field that the date look short date and other record looks like a date together with the time, can do an update query to make it all short date, How ?
-
- Administrator
- Posts: 78574
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: How to fix a Field with a Date Mix
Let's say that the field is named MyDate.
Create a query based on the table.
Add the MyDate field to the query grid.
In the Query Type group of the Design tab of the ribbon, click Update Query.
Enter the following in the Update to line:
Int([MyDate])
using the actual name of the field, of course.
Click the Run button (the red exclamation mark) and confirm that you want to update the records.
Create a query based on the table.
Add the MyDate field to the query grid.
In the Query Type group of the Design tab of the ribbon, click Update Query.
Enter the following in the Update to line:
Int([MyDate])
using the actual name of the field, of course.
Click the Run button (the red exclamation mark) and confirm that you want to update the records.
Best wishes,
Hans
Hans
-
- 2StarLounger
- Posts: 119
- Joined: 01 Jul 2013, 14:08
Re: How to fix a Field with a Date Mix
That works, perfectly
Thanks
If I want the date, to enter like that always, how should create this date field ?
and how about that command ( Int )
Thanks
If I want the date, to enter like that always, how should create this date field ?
and how about that command ( Int )
-
- Administrator
- Posts: 78574
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: How to fix a Field with a Date Mix
You could set the Input Mask property of the field - click the ... on the right hand side of the property and select Short Date or Medium Date as Input Mask.
The Int function rounds a number down to a whole number.
Access stores dates and times as numbers, with 1 day as unit. The time is the decimal part of the number, e.g. 6:00 AM is 0.25 (6/24 of 1 day). Rounding the date+time to a whole number removes the time part.
The Int function rounds a number down to a whole number.
Access stores dates and times as numbers, with 1 day as unit. The time is the decimal part of the number, e.g. 6:00 AM is 0.25 (6/24 of 1 day). Rounding the date+time to a whole number removes the time part.
Best wishes,
Hans
Hans