Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

i want to export date info from ms a2k to csv text w/o quotations

Status
Not open for further replies.

uscitizen

Technical User
Jan 17, 2003
672
US
from my query, when i export a date using

Expr1:Format([Subm_Date],"yyyymmdd")

into a csv text file and my date is, for example, 01/01/2001 (January 1st, 2001), the value appearing in my output file is

"20010101"

WITH quotations (as show above) surrounding it.

the thing is, i don't want the quotations around the quantity being exported; i would want to see it exported as
in the resulting csv text file

20010101

[note there are no quotations above].

so i am pulling my hair out trying to convince ms a2k to behave itself and output my dates as just shown.

having not much luck, i came up with the idea that if i could find a string function to remove the two occurences of the quotations from "20010101" my problem'd be licked. the thing is that my reference sources aren't turning up very many string functions (assuming that this is way to go in the first place). i have tried using the "Val" function i think it was called, to convert the string to numerical, BUT (very weird) in the above instance it returns 200111 (omitting the leading zeroes from the month and day's values)

anyone listening?


“The philosophy of the school room in one generation will be the philosophy of government in the next." --- Abraham Lincoln
 
Instead of SQL removing the quotes, an easier way to do it, is to open the file with wordpad, then do a replace on the qutoes. It should be fairly fast.

You can also do the replace in Word, maybe set up a macro to perform the task, saving some typing.
 
well, that's an idea, however i may have oversimplified the situation just a bit....y'see the date field is just one of many fields including number and character (names, disease types, etc. etc) being exported, so removing all quotations wouldn't really work.

i have given over a little thought to replacing the datetime type in the table where the dates are entered with a number type (probably long integer) and instructing the enterer to go ahead and enter a date as

20010101

when she wants to enter January 1, 2001 and so forth.

i reason that when exporting this value to the csv text file it would be exported w/o encapsulating quotations.
also, since there i am not aware of any intrinsic value in keeping date information stored as date information i might just go ahead and find out what results when i export it.

it would be neat to have one's cake and eat it too, but i don't think that it's an absolute drop dead essential.



“The philosophy of the school room in one generation will be the philosophy of government in the next." --- Abraham Lincoln
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top