dk04
asked on
Changing Access date/time field to date only
I'm trying to link a fiscal calendar in Access with data in another database through Crystal Reports. The problem I'm having is that Access date field is date/time and the other data base is just date.
Is their a way to make the access field just date and not date/time?
Is their a way to make the access field just date and not date/time?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
As JDettman said, it will always have a time value in the database. You can only control what is displayed when you use the field in your application.
If you want to simulate it in the database, you can set the viewing format of the field when you design the table to be a short date. The database will still have the time but when you look at them you will only see the date. you will stilll have to format the data in your application to only show the dat.
mlmcc
If you want to simulate it in the database, you can set the viewing format of the field when you design the table to be a short date. The database will still have the time but when you look at them you will only see the date. you will stilll have to format the data in your application to only show the dat.
mlmcc
In Crystal you can use DATE({YourField}) to only show the date.
mlmcc
mlmcc
in ACCESS, convert first the DateTimeField to Date only with the expression
DateValue([DateTimeFieldna me])
if you want use it in Crystal report
Create a New Field (Date/Time) in your table, then Run this query
Update TableX set newDateField=DateValue([Da teTimeFiel dname])
use the newDateField in Crystal report
DateValue([DateTimeFieldna
if you want use it in Crystal report
Create a New Field (Date/Time) in your table, then Run this query
Update TableX set newDateField=DateValue([Da
use the newDateField in Crystal report
ASKER
capricorn1: The field still comes up as DateTime in Crystal instead of date. When I browse to view the data it has the time in it with the date.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can use a Long Integer instead of a date. I use that often if I want to prevent any accidental time portion in a date field. A Long Integer formatted as date works (almost) just like a date field. If Crystal uses the same date numbering scheme (I wouldn't know), you can try to import long integers: CLng([your date]). But globally, I think this is a problem in Crystal, not in the data transfer.
(°v°)
(°v°)
ASKER
DateValue([DateTimeFieldna