Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / January 2006

Tip: Looking for answers? Try searching our database.

Exporting Date includes 0:00:00 - Don't Want That!

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
magmike - 10 Jan 2006 18:42 GMT
My query includes a date field (namely named 'Date') which, when exported,
includes the data, plus the addition of  a null time (0:00:00). My table
field is set as a Date/Time field, and is formatted for just the date
(YYYY-MM-DD). If I switch the table field to a text field, this allows me to
just export the field data, but then I have no control over it's formatting
(and it returns as MM/DD/YYYY).

I tried the Int(Date) command (seen in other post with same problem), but it
returns a long integer. I tried the DatePart(Date) command, but can only get
it to include part of the date. When I try formatting the command for the
whole date, I get an error.

Has anybody experienced this before and found a solution?

Thanks,

Mike
Rick Brandt - 10 Jan 2006 18:44 GMT
> My query includes a date field (namely named 'Date') which, when
> exported, includes the data, plus the addition of  a null time
[quoted text clipped - 9 lines]
>
> Has anybody experienced this before and found a solution?

Format properties used in a table will not affect the data that is exported.
Create a query and in the query use the Format() function to format the date
the way you want and then export the query instead of the table.
Signature

I don't check the Email account attached
to this message.     Send instead to...
RBrandt    at       Hunter      dot      com

magmike - 10 Jan 2006 18:59 GMT
I'm not sure where I would use that, but under the properties of the Date
query field, I set yyyy-mm-dd in the format field of the properties.
However, that works for the visual results inside the database, but still
wants to export the empty time.

>> My query includes a date field (namely named 'Date') which, when
>> exported, includes the data, plus the addition of  a null time
[quoted text clipped - 14 lines]
> format the date the way you want and then export the query instead of the
> table.
Rick Brandt - 11 Jan 2006 01:53 GMT
> I'm not sure where I would use that, but under the properties of the
> Date query field, I set yyyy-mm-dd in the format field of the
> properties. However, that works for the visual results inside the
> database, but still wants to export the empty time.

As I said, the format properties are PRECISELY responsible for display within
the Access GUI they do not affect the actual data and therefore do not affect
what is exported.  If you build a query you can use the format function to
transform your date into a string that has the format you want and then you
export the query instead of the table.

Signature

I don't check the Email account attached
to this message.     Send instead to...
RBrandt    at       Hunter      dot      com

magmike - 11 Jan 2006 03:29 GMT
How do I use the Format function? In the Criteria field? I'm not writing raw
SQL here. I'm using the Query Design View.

PS - I AM exporting from the query.

>> I'm not sure where I would use that, but under the properties of the
>> Date query field, I set yyyy-mm-dd in the format field of the
[quoted text clipped - 6 lines]
> function to transform your date into a string that has the format you want
> and then you export the query instead of the table.
Rick Brandt - 11 Jan 2006 03:41 GMT
> How do I use the Format function? In the Criteria field? I'm not
> writing raw SQL here. I'm using the Query Design View.
>
> PS - I AM exporting from the query.

In your query where you currently have the name of your date field [Date] (which
is a bad name for a field BTW since that is a reserved word) replace that
with...

Format([Date], "YYYY-MM-DD")

Signature

I don't check the Email account attached
to this message.     Send instead to...
RBrandt    at       Hunter      dot      com

magmike - 12 Jan 2006 02:41 GMT
> Format([Date], "YYYY-MM-DD")

Worked beautifully! Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.