Export Date without Time to text tab delimited file

Export Date without Time to text tab delimited file

Post by d29ya3dlZW » Fri, 29 Aug 2008 01:24:00


I need to export a table to a tab delimited text file. I have a date field
in the file. I need it to export as just the date without the time. I have
an input mask of short date on the field, but it still exports with the time.
Currently exports as 8/26/2008 00:00:00... Need to export as 8/26/2008.
 
 
 

Export Date without Time to text tab delimited file

Post by SmVycnkgV2 » Fri, 29 Aug 2008 03:15:05

Create a query based on the table. Use the Format function to produce the
date as you like to see it. Export the returns from this new query instead of
the table.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.

 
 
 

Export Date without Time to text tab delimited file

Post by S2xhdHV » Fri, 29 Aug 2008 06:04:02

Jerry's answer is correct, but to give you some additional info.
the Input Mask property has no effect on how data is stored in a field or
how it id displated. It is only used during data entry to assist a user in
entering a value correctly.
Also, if you are using Now() to populate the field, but you really only care
about the date, you should be using Date(). That is because any comparisons
you use on a date field that has times in it will likely be wrong if you
don't also include the time down to the second.

Note that all date fields do contain a time component, but the Date function
always returns midnight - 08/2702009 00:00:00 AM But, if you use Now, it
will include the time - 8/27/2008 4:00:39 PM

So, if you are looking for records for a date, say today's date:

SELECT * FROM SomeTable WHERE [MyDateField] = Date();
8/27/2008 4:00:39 PM not be included.
--
Dave Hargis, Microsoft Access MVP
 
 
 

Export Date without Time to text tab delimited file

Post by RGFsZSBGeW » Sat, 30 Aug 2008 22:05:00

You could also use the DateValue function (instead of Format() ) to get just
the date portion of the field value.

--
HTH
Dale

Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.