Link to home
Start Free TrialLog in
Avatar of dk04
dk04Flag for United States of America

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?
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dk04

ASKER

capricorn1: In crystal it still puts the time in the field after using
DateValue([DateTimeFieldname])
 
 
Avatar of Mike McCracken
Mike McCracken

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
In Crystal you can use DATE({YourField}) to only show the date.

mlmcc
in ACCESS, convert first the DateTimeField to Date only with the expression

   DateValue([DateTimeFieldname])

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([DateTimeFieldname])

use the newDateField in Crystal report
Avatar of dk04

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
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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°)