Re: DBDATE / DBMONEY in SQL ändern ??



On Tue, 2007-07-10 at 12:59 +0000, Ian Michael Gumby wrote:


From: Carsten Haese <carsten@xxxxxxxxxxx>
On Tue, 2007-07-10 at 09:39 +0000, hoffiman@xxxxxxxxxxxxxx wrote:

[Bitte, Ich spreche nicht Deutsches.]

In English:

I'm not aware of a way to set the date format with an SQL command. One
possibility would be to load the data into an auxiliary table that is
identical to the target table except that date columns are replaced by
char(10) columns. You can then transfer the data to the target table and
translate the date columns with mdy(x[6,7],x[9,10],x[1,4]) into real
dates.

Hope this helps,

--
This doesn't make sense.

Maybe that's because you nicht sprechen Deutsch ;)

The date is stored in an intermediate format and should be formattable via
regex from the SQL statement. (Sorry my mind is a bit garbled from doing too
many different database things as well as languages.)

There should be an SQL function that would allow you to format the date from
the internal format to a more readable string on the fly.

The OP wants to go the other way. He has an unload file with dates in
yyyy-mm-dd format and wants to load them into a date column without
setting the DBDATE environment variable. I suggested one way of doing
that. It probably is neither the only way nor the best way to do this,
but it is a way to achieve what the OP asked for.

--
Carsten Haese
http://informixdb.sourceforge.net


.



Relevant Pages

  • Re: Inserting regional settings specific data into sql server
    ... All EU countries withouth the two English speaking use the format dd-MM-yy ... By using the parameters, while the program is in the right culture setting, ... than all those formats results using SQLparameters in the way the SQL server ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Inserting regional settings specific data into sql server
    ... Italianyou will observe that the settings used are 10/02/2006 ... it a better idea to Format it using the string format functions or a very ... into the sql database.Sorry to bug the shorts off you but u now have context ... By using the parameters, while the program is in the right culture setting, ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Moving a VBA function to SQL server
    ... SQL is a set-based language. ... "String Functions " in Books Online. ... This will produce a job header formatted like this: ... The format he specifies is stored in table 'Settings' - field 'JobHdrMask' ...
    (comp.databases.ms-access)
  • Re: Prepare, SQL query with to_date call
    ... SQL query with to_date call ... The Oracle ODBC driver has a problem with date parameters although I'm ... using a date format containing the RR format. ...
    (perl.dbi.users)
  • Re: Searching on DATETIME Fields
    ... So First try quoting the string, then ensure that the format of the date ... Wayne Snyder, MCDBA, SQL Server MVP ... >>> The field I am querying is of DATETIME data type, ...
    (microsoft.public.sqlserver.server)