Question Export 01-JAN-2011 format to a txt file

Local time
Today, 17:24
Joined
Sep 6, 2011
Messages
5
I need to export dates in the format dd-mmm-yyyy (eg 01-JAN-2011) as part of a tab delimited txt file. I cant pass it as a string, it must not have text delimiters in the field. Using Access 2007. text file will be picked up by Oracle application.
Thanks
Andy
 
Hi George - thanks for helping with this one - but no. I'm afriad it's more complex than that - I know all about date formatting IN Access, and I have a table that holds the dates in the format I need (01-JAN-2011)
But the problem occurs when I try to Export FROM Access to a txt delimited. Using a File Specification and checking the sample data view - it all looks good, but the resulting txt file will always show 01/01/2011 00:00:00.

I've put some examples of data in the table and the file specifications used for export as attachments - i hope this helps.
 

Attachments

  • SampleTableData.JPG
    SampleTableData.JPG
    28.8 KB · Views: 110
  • SampleTextFileExport.JPG
    SampleTextFileExport.JPG
    36 KB · Views: 110
Try and explicitly remove the timecomponent of your datefield.

Code:
select format([COLOR=#ff0000]Int([/COLOR]mydate[COLOR=red])[/COLOR], 'dd-mmm-yyyy'), myothercolumns
from mytable
where myconditions = somecondition


JR
 
Hi,
Yes, the stripping of the time component is great - but my biggest issue is still that I want the date in the text file to still look like 01-JAN-2011. It needs to remain a date type, not a string with text delimiteers (which was my other idea)
 
So you need the text delimiters on the text fields though, correct? But not on the date field.
 
Well, I think we're going to have to build the text file via code and not using export features. Are you up for that? I can help put it together for you.
 
Hi Bob,
Yes, you'r validating where I was fearing I'd have to tread. I know how to build it in code, I was just REALLY, REALLY trying to avoid all that work just for one little issue.
Never mind - thanks for your help. Maybe I can help someone else in turn.
Cheers

Andy
 
Unfortunately while it seems like a little issue, it isn't because it is a non-standard result that is required. The exporting isn't all that robust to be able to handle those type of exceptions (although I wish it were).
 

Users who are viewing this thread

Back
Top Bottom