Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: Date Field when exporting


Message #1 by "John Pace" <jpace@h...> on Mon, 26 Nov 2001 08:20:35 -0600
OK, quick.  When I export a table to a .txt file, I get the following

output:



2051,21014,0,110022,L,REG,11/30/01 0:00:00,3.00

2051,21014,0,105005,L,REG,11/30/01 0:00:00,3.00

2051,21014,0,262077,L,REG,11/30/01 0:00:00,2.50

2079,21014,0,2020110,L,REG,11/15/01 0:00:00,3.00

2079,21014,0,221045,L,REG,11/15/01 0:00:00,3.50

2051,21014,0,871010,L,REG,11/15/01 0:00:00,2.00

2051,21014,0,1027010,L,REG,11/15/01 0:00:00,4.00

2051,21014,0,340132,L,REG,11/15/01 0:00:00,3.00

2079,21014,0,400104,L,REG,11/15/01 0:00:00,2.00

2079,21014,0,1520001,L,REG,11/15/01 0:00:00,5.00



The problem is with the 2nd to last field.  In my db, it is a short date

field. It only displays as mm/dd/yy.  How come when I export it, I get

mm/dd/yy h:mm:ss.  I do not need the time portion.  How do I make it only

export the date, not the time?  Will I have to do it manually by recordset

manipulation?





John Pace

Manager of Information Technologies

Haws and Tingle General Contractors

650 West Vickery Blvd

Fort Worth, TX  76104

xxx-xxx-xxxx

Fax:   xxx-xxx-xxxx

E-Mail:  jpace@h...

www.hawstingle.com



Message #2 by brian.skelton@b... on Mon, 26 Nov 2001 14:56:35
John



The quickest fix for this problem is to export a query based on your 

table, rather than the table itself. If you format the date field in the 

query, the formatting is included in the exported text. Something like 

this:



SELECT field1,field1,field1,field1,field1,field1,format(field1,"short 

date"),field1, FROM table1



-Brian



> OK, quick.  When I export a table to a .txt file, I get the following

> output:

> 

> 2051,21014,0,110022,L,REG,11/30/01 0:00:00,3.00

> 2051,21014,0,105005,L,REG,11/30/01 0:00:00,3.00

> 2051,21014,0,262077,L,REG,11/30/01 0:00:00,2.50

> 2079,21014,0,2020110,L,REG,11/15/01 0:00:00,3.00

> 2079,21014,0,221045,L,REG,11/15/01 0:00:00,3.50

> 2051,21014,0,871010,L,REG,11/15/01 0:00:00,2.00

> 2051,21014,0,1027010,L,REG,11/15/01 0:00:00,4.00

> 2051,21014,0,340132,L,REG,11/15/01 0:00:00,3.00

> 2079,21014,0,400104,L,REG,11/15/01 0:00:00,2.00

> 2079,21014,0,1520001,L,REG,11/15/01 0:00:00,5.00

> 

> The problem is with the 2nd to last field.  In my db, it is a short date

> field. It only displays as mm/dd/yy.  How come when I export it, I get

> mm/dd/yy h:mm:ss.  I do not need the time portion.  How do I make it only

> export the date, not the time?  Will I have to do it manually by 

recordset

> manipulation?

> 

> 

> John Pace

> Manager of Information Technologies

> Haws and Tingle General Contractors

> 650 West Vickery Blvd

> Fort Worth, TX  76104

> xxx-xxx-xxxx

> Fax:   xxx-xxx-xxxx

> E-Mail:  jpace@h...

> www.hawstingle.com

> 

Message #3 by "John Pace" <jpace@h...> on Mon, 26 Nov 2001 09:15:51 -0600
Brian,



That did not work.  I still get the same results.  Help!!!



John



-----Original Message-----

From: brian.skelton@b...

[mailto:brian.skelton@b...]

Sent: Monday, November 26, 2001 2:57 PM

To: Access

Subject: [access] Re: Date Field when exporting





John



The quickest fix for this problem is to export a query based on your 

table, rather than the table itself. If you format the date field in the 

query, the formatting is included in the exported text. Something like 

this:



SELECT field1,field1,field1,field1,field1,field1,format(field1,"short 

date"),field1, FROM table1



-Brian



> OK, quick.  When I export a table to a .txt file, I get the following

> output:

> 

> 2051,21014,0,110022,L,REG,11/30/01 0:00:00,3.00

> 2051,21014,0,105005,L,REG,11/30/01 0:00:00,3.00

> 2051,21014,0,262077,L,REG,11/30/01 0:00:00,2.50

> 2079,21014,0,2020110,L,REG,11/15/01 0:00:00,3.00

> 2079,21014,0,221045,L,REG,11/15/01 0:00:00,3.50

> 2051,21014,0,871010,L,REG,11/15/01 0:00:00,2.00

> 2051,21014,0,1027010,L,REG,11/15/01 0:00:00,4.00

> 2051,21014,0,340132,L,REG,11/15/01 0:00:00,3.00

> 2079,21014,0,400104,L,REG,11/15/01 0:00:00,2.00

> 2079,21014,0,1520001,L,REG,11/15/01 0:00:00,5.00

> 

> The problem is with the 2nd to last field.  In my db, it is a short date

> field. It only displays as mm/dd/yy.  How come when I export it, I get

> mm/dd/yy h:mm:ss.  I do not need the time portion.  How do I make it only

> export the date, not the time?  Will I have to do it manually by 

recordset

> manipulation?

> 

> 

> John Pace

> Manager of Information Technologies

> Haws and Tingle General Contractors

> 650 West Vickery Blvd

> Fort Worth, TX  76104

> xxx-xxx-xxxx

> Fax:   xxx-xxx-xxxx

> E-Mail:  jpace@h...

> www.hawstingle.com

> 










Message #4 by "Joseph N. Stackhouse" <joe@s...> on Mon, 26 Nov 2001 10:40:36 -0500
John,



	Make sure when your setting the dates (if you are) using code or

DefaultValue to use =Date() not =Now().



As you can see they return different values.

?Date()

11/26/2001 

?Now()

11/26/2001 10:38:54 AM 



	I've seen instances where people use Now() and then wonder why

they get HH:MM:SS A/P returned instead of just mm/dd/yy.

	

	-Joe





-----Original Message-----

From: John Pace [mailto:jpace@h...] 

Sent: Monday, November 26, 2001 9:21 AM

To: Access

Subject: [access] Date Field when exporting





OK, quick.  When I export a table to a .txt file, I get the following

output:



2051,21014,0,110022,L,REG,11/30/01 0:00:00,3.00

2051,21014,0,105005,L,REG,11/30/01 0:00:00,3.00

2051,21014,0,262077,L,REG,11/30/01 0:00:00,2.50

2079,21014,0,2020110,L,REG,11/15/01 0:00:00,3.00

2079,21014,0,221045,L,REG,11/15/01 0:00:00,3.50

2051,21014,0,871010,L,REG,11/15/01 0:00:00,2.00

2051,21014,0,1027010,L,REG,11/15/01 0:00:00,4.00

2051,21014,0,340132,L,REG,11/15/01 0:00:00,3.00

2079,21014,0,400104,L,REG,11/15/01 0:00:00,2.00

2079,21014,0,1520001,L,REG,11/15/01 0:00:00,5.00



The problem is with the 2nd to last field.  In my db, it is a short date

field. It only displays as mm/dd/yy.  How come when I export it, I get

mm/dd/yy h:mm:ss.  I do not need the time portion.  How do I make it

only export the date, not the time?  Will I have to do it manually by

recordset manipulation?





John Pace

Manager of Information Technologies

Haws and Tingle General Contractors

650 West Vickery Blvd

Fort Worth, TX  76104

xxx-xxx-xxxx

Fax:   xxx-xxx-xxxx

E-Mail:  jpace@h...

www.hawstingle.com





---

You are currently subscribed to access as: joe@s... To

unsubscribe send a blank email to $subst('Email.Unsub')






  Return to Index