How Convert UNICODE To Datetime
Sep 5, 2006Hi Everybody,
I have a column Fecha_Apertura int(4) that content data as 1157472771, and I need convert this to datetime.
Someone know of any script?
Thanks by your help
Hi Everybody,
I have a column Fecha_Apertura int(4) that content data as 1157472771, and I need convert this to datetime.
Someone know of any script?
Thanks by your help
Hello,
I have tried a few different things within a Derived Column transform to convert a unicode yymmdd date string to SQL Server DateTime.
Does anyone have ideas on how to do this?
Thank you for your help!
cdun2
I am following the SSIS overview video- URL...I have a flat file that i want to import the contents onto a SQL database.I created a Dataflow task, source file and oledb destination.I am getting the folliwung error -"column "A" cannot convert between unicode and non-unicode string data types".in the origin file the data type is coming as string[DT_STR] and in the destination object it is coming as "Unicode string [DT_WSTR]"I used a data conversion object in between, dosent works very well
View 5 Replies View RelatedGood afternoon
View 32 Replies View RelatedI have an SSIS package that pulls data from a MYSQL DB (Using RSSBus for Salesforce in SSIS to accomplish this). Most of the columns are loading properly, but I have many columns that I need to convert.
I have been using the Data Conversion dataflow task in SSIS to convert the rows.
I have 2 data conversions that work on most of the columns, but the DESCRIPTION column continues to return an error saying "Cannot convert between unicode and non-unicode types", regardless of what I choose on the Data Conversion task. So, basically I want to dump this column data into a SQL table with NVARCHAR datatypes. Here is what I am doing in my SSIS package...
1) Grab subset of data from SOURCE
2) Converts to TEXTSTREAM. (Data Conversion)
3) Converts to STRING. (Data Conversion)
4) Load Destination table. (OLE DB Destination)
I have also tried to simply convert the values to STRING, but that doesn't work either.
So, I have 2 Data Conversions working here that process most of the data correctly. What I can do to load the DESCRIPTION column?
I have an Excel Source component hooked to an OLE DB Destination component in my SSIS 2005 Data Flow Task. After I mapped the excel columns to the OLE DB table columns i get these errors below. I noticed that for the first error, the Excel Field format (when you mouse over the column name in the mappings section in OLE DB component) is of type [DTWSTR] and the corresponding SQL field from my SQL table that it's mapping to is of type [DT_STR] when mousing over that field in the mappings in the properties of my OLE DB component. All table fields in SQL Server for the table I'm inserting into are of type varchar.
print screens here:
http://www.webfound.net/excel_ssis.jpg
http://www.webfound.net/excel_to_oledb_mappings.jpg
Package Validation Error
------------------------------
ADDITIONAL INFORMATION:
Error at Data Flow Task [OLE DB Destination [27]]: Columns "Commission Agency" and "CommissionAgency" cannot convert between unicode and non-unicode string data types.
Error at Data Flow Task [OLE DB Destination [27]]: Column "Product" cannot convert between unicode and non-unicode string data types.
Error at Data Flow Task [OLE DB Destination [27]]: Columns "Officer Code" and "OfficerCode" cannot convert between unicode and non-unicode string data types.
Error at Data Flow Task [OLE DB Destination [27]]: Columns "Agency Name" and "AgencyName" cannot convert between unicode and non-unicode string data types.
Error at Data Flow Task [OLE DB Destination [27]]: Columns "Agency Id" and "AgencyID" cannot convert between unicode and non-unicode string data types.
Error at Data Flow Task [OLE DB Destination [27]]: Columns "Tran Code" and "TranCode" cannot convert between unicode and non-unicode string data types.
Error at Data Flow Task [OLE DB Destination [27]]: Columns "User Id" and "UserID" cannot convert between unicode and non-unicode string data types.
Error at Data Flow Task [OLE DB Destination [27]]: Columns "Acct Number" and "AccountNumber" cannot convert between unicode and non-unicode string data types.
Error at Data Flow Task [DTS.Pipeline]: "component "OLE DB Destination" (27)" failed validation and returned validation status "VS_ISBROKEN".
Error at Data Flow Task [DTS.Pipeline]: One or more component failed validation.
Error at Data Flow Task: There were errors during task validation.
(Microsoft.DataTransformationServices.VsIntegration)
HI.
I'm having this problem.
I use Visual Studio's, integration project to load XML file into SQL Server. In the XML file, i have defined collumns as string. When i try to load XML file with parts defined in scheme as string, i get an error "cannot convert between unicode and non-unicode string data type.
Destinated collumns in SQL are defined as varchar and char.
Thanks for help
For packages that I have created to read Oracle 10g tables, that work fine with debugging in 32-bit mode, I get an error message on all string fields when I try to run in 64-bit mode. An example error message is:[OLE DB Source [1]] Error: Column "ACCT_UNIT" cannot convert between unicode and non-unicode string data types.Another interesting warning included is:[OLE DB Source [1]] Warning: The external columns for component "OLE DB Source" (1) are out of synchronization with the data source columns. The external column "ACCT_UNIT" needs to be updated.I cannot even try to convert this data with a Data Conversion item because the (red) error is on the OLE DB Source item and stops there. It doesn't matter what the destination is or even if there is a destination in the package yet.I'm using Oracle Provider for OLE DB, Oracle Client version 10.203 for 32-bit and Oracle Client 10.204 for 64-bit.Oracle is 10g on a UNIX 64-bit server and the data is not unicode.I'm using SQL Server Enterprise 2008 (10.0.1600) on Windows Server 2008 Standard SP1 on a 64-bit server.The packages work fine in 32-bit mode and the data is not unicode data. When I change Run64BitRuntime to True in the Debugging Property Page, I get the error on the OLE DB Source item. I also get the error when I schedule a package to run using the SQL Server Agent.
View 4 Replies View RelatedHi,
I have spent countless number of hours trying to solve the issue, but to no vail. My problem is SSIS throws "cannot convert between unicode and non-unicode string data types" when i am try to transform data from DB2 to SQL Server 2005. And please note, i tried all possibilities like changing the destination field which is in SQL Server 2005 to nvarchar and also text. But so far no help. And i also looked at previous posts which did not help me either.
Thank You in advance.
I have built a large package and due to database changes (varchar to nvarchar) I need to do a data conversion of all the flat file columns I am bringing in, to a unicode data type. The way I know how to do this is via the data conversion component/task. My question is, I am looking for an easy way to "Do All Columns" and "Map all Columns" without doing every column by hand in both spots.
I need to change all the columns, can I do this in mass? More importantly once I convert all these and connect it to my data source it fails to map converted fields by name. Is there a way when using the data conversion task to still get it to map by name when connecting it to the OLE destination?
I know I can use the wizard to create the base package, but I have already built all the other components, renamed and set the data type and size on all the columns (over 300) and so I don't want to have to re-do all that work. What is the best solution?
In general I would be happy if I could get the post data conversion to map automatically to the source. But because its DataConversion.CustomerID it will not map to CustomerID field on destination. Any suggestions on the best way to do this would save me hours of work...
Thanks.
I keep getting the error message below when attempting to import a text file (flat file) to an SQL Server Destination using SSIS. This database has recently been migrated from SQL Server 2000 (where I used a DTS Package that worked fine). I plan on doing further manipulation to the file after importing but have so far tried to keep one step at a time. I have tried using a smaller files and different tables but still get a similar response. I believe that the encoding of the text file is ANSI. If it is relevant the database collation is Latin1_General_CI_AS (the same as it was when 2000). Any help anyone can provide will be greatly appreciated!!!
TITLE: Package Validation Error
------------------------------
Package Validation Error
------------------------------
ADDITIONAL INFORMATION:
Error at Data Flow Task [SQL Server Destination [174]]: Columns "Column 0" and "AccountNumber" cannot convert between unicode and non-unicode string data types.
Error at Data Flow Task [SQL Server Destination [174]]: The column "Column 1" can't be inserted because the conversion between types DT_STR and DT_I4 is not supported.
Error at Data Flow Task [SQL Server Destination [174]]: The column "Column 2" can't be inserted because the conversion between types DT_STR and DT_I4 is not supported.
Error at Data Flow Task [SQL Server Destination [174]]: Columns "Column 3" and "Name" cannot convert between unicode and non-unicode string data types.
Error at Data Flow Task [SQL Server Destination [174]]: The column "Column 4" can't be inserted because the conversion between types DT_STR and DT_I4 is not supported.
Error at Data Flow Task [SQL Server Destination [174]]: The column "Column 5" can't be inserted because the conversion between types DT_STR and DT_R8 is not supported.
Error at Data Flow Task [SQL Server Destination [174]]: Columns "Column 6" and "ExpiryDate" cannot convert between unicode and non-unicode string data types.
Error at Data Flow Task [SQL Server Destination [174]]: Columns "Column 7" and "RateType" cannot convert between unicode and non-unicode string data types.
Error at Data Flow Task [SQL Server Destination [174]]: The column "Column 8" can't be inserted because the conversion between types DT_STR and DT_BOOL is not supported.
Error at Data Flow Task [SQL Server Destination [174]]: Columns "Column 9" and "FullName" cannot convert between unicode and non-unicode string data types.
Error at Data Flow Task [SQL Server Destination [174]]: Columns "Column 10" and "Address" cannot convert between unicode and non-unicode string data types.
Error at Data Flow Task [SQL Server Destination [174]]: The column "Column 11" can't be inserted because the conversion between types DT_STR and DT_DBTIMESTAMP is not supported.
Error at Data Flow Task [SQL Server Destination [174]]: The column "Column 12" can't be inserted because the conversion between types DT_STR and DT_I4 is not supported.
Error at Data Flow Task [SQL Server Destination [174]]: The column "Column 13" can't be inserted because the conversion between types DT_STR and DT_DBTIMESTAMP is not supported.
Error at Data Flow Task [SQL Server Destination [174]]: Columns "Column 14" and "Occupancy" cannot convert between unicode and non-unicode string data types.
Error at Data Flow Task [SQL Server Destination [174]]: Columns "Column 15" and "LoanPurpose" cannot convert between unicode and non-unicode string data types.
Error at Data Flow Task [SQL Server Destination [174]]: The column "Column 16" can't be inserted because the conversion between types DT_STR and DT_R8 is not supported.
Error at Data Flow Task [SQL Server Destination [174]]: The column "Column 17" can't be inserted because the conversion between types DT_STR and DT_R8 is not supported.
Error at Data Flow Task [SQL Server Destination [174]]: The column "Column 18" can't be inserted because the conversion between types DT_STR and DT_R8 is not supported.
Error at Data Flow Task [SQL Server Destination [174]]: The column "Column 19" can't be inserted because the conversion between types DT_STR and DT_R8 is not supported.
Error at Data Flow Task [SQL Server Destination [174]]: The column "Column 20" can't be inserted because the conversion between types DT_STR and DT_I4 is not supported.
Error at Data Flow Task [SQL Server Destination [174]]: The column "Column 21" can't be inserted because the conversion between types DT_STR and DT_I4 is not supported.
Error at Data Flow Task [SQL Server Destination [174]]: The column "Column 22" can't be inserted because the conversion between types DT_STR and DT_I4 is not supported.
Error at Data Flow Task [SQL Server Destination [174]]: Columns "Column 23" and "DocumentLocation" cannot convert between unicode and non-unicode string data types.
Error at Data Flow Task [SQL Server Destination [174]]: The column "Column 24" can't be inserted because the conversion between types DT_STR and DT_I4 is not supported.
Error at Data Flow Task [SQL Server Destination [174]]: Columns "Column 25" and "SecurityType" cannot convert between unicode and non-unicode string data types.
Error at Data Flow Task [SQL Server Destination [174]]: The column "Column 26" can't be inserted because the conversion between types DT_STR and DT_R8 is not supported.
Error at Data Flow Task [SQL Server Destination [174]]: The column "Column 27" can't be inserted because the conversion between types DT_STR and DT_DBTIMESTAMP is not supported.
Error at Data Flow Task [SQL Server Destination [174]]: The column "Column 28" can't be inserted because the conversion between types DT_STR and DT_R8 is not supported.
Error at Data Flow Task [SQL Server Destination [174]]: Columns "Column 29" and "MortgageInsurancePolicyNumber" cannot convert between unicode and non-unicode string data types.
Error at Data Flow Task [SQL Server Destination [174]]: Columns "Column 30" and "SecurityAddress" cannot convert between unicode and non-unicode string data types.
Error at Data Flow Task [SQL Server Destination [174]]: The column "Column 31" can't be inserted because the conversion between types DT_STR and DT_I4 is not supported.
Error at Data Flow Task [SQL Server Destination [174]]: The column "Column 32" can't be inserted because the conversion between types DT_STR and DT_R8 is not supported.
Error at Data Flow Task [SQL Server Destination [174]]: The column "Column 33" can't be inserted because the conversion between types DT_STR and DT_R8 is not supported.
Error at Data Flow Task [SQL Server Destination [174]]: The column "Column 34" can't be inserted because the conversion between types DT_STR and DT_R8 is not supported.
Error at Data Flow Task [SQL Server Destination [174]]: The column "Column 35" can't be inserted because the conversion between types DT_STR and DT_R8 is not supported.
Error at Data Flow Task [SQL Server Destination [174]]: The column "Column 36" can't be inserted because the conversion between types DT_STR and DT_R8 is not supported.
Error at Data Flow Task [SQL Server Destination [174]]: The column "Column 37" can't be inserted because the conversion between types DT_STR and DT_DBTIMESTAMP is not supported.
Error at Data Flow Task [SQL Server Destination [174]]: Columns "Column 38" and "SecuritySuburb" cannot convert between unicode and non-unicode string data types.
Error at Data Flow Task [SQL Server Destination [174]]: The column "Column 39" can't be inserted because the conversion between types DT_STR and DT_I4 is not supported.
Error at Data Flow Task [SQL Server Destination [174]]: The column "Column 40" can't be inserted because the conversion between types DT_STR and DT_R8 is not supported.
Error at Data Flow Task [SQL Server Destination [174]]: The column "Column 41" can't be inserted because the conversion between types DT_STR and DT_R8 is not supported.
Error at Data Flow Task [SQL Server Destination [174]]: The column "Column 42" can't be inserted because the conversion between types DT_STR and DT_R8 is not supported.
Error at Data Flow Task [SQL Server Destination [174]]: Columns "Column 43" and "MortgageNumber" cannot convert between unicode and non-unicode string data types.
Error at Data Flow Task [SQL Server Destination [174]]: Columns "Column 44" and "TitleParticulars" cannot convert between unicode and non-unicode string data types.
Error at Data Flow Task [SQL Server Destination [174]]: The column "Column 45" can't be inserted because the conversion between types DT_STR and DT_DBTIMESTAMP is not supported.
Error at Data Flow Task [SQL Server Destination [174]]: The column "Column 46" can't be inserted because the conversion between types DT_STR and DT_DBTIMESTAMP is not supported.
Error at Data Flow Task [SQL Server Destination [174]]: The column "Column 47" can't be inserted because the conversion between types DT_STR and DT_DBTIMESTAMP is not supported.
Error at Data Flow Task [SQL Server Destination [174]]: The column "Column 48" can't be inserted because the conversion between types DT_STR and DT_I4 is not supported.
Error at Data Flow Task [SQL Server Destination [174]]: The column "Column 49" can't be inserted because the conversion between types DT_STR and DT_R8 is not supported.
Error at Data Flow Task [SQL Server Destination [174]]: The column "Column 50" can't be inserted because the conversion between types DT_STR and DT_R8 is not supported.
Error at Data Flow Task [SQL Server Destination [174]]: The column "Column 51" can't be inserted because the conversion between types DT_STR and DT_DBTIMESTAMP is not supported.
Error at Data Flow Task [DTS.Pipeline]: "component "SQL Server Destination" (174)" failed validation and returned validation status "VS_ISBROKEN".
Error at Data Flow Task [DTS.Pipeline]: One or more component failed validation.
Error at Data Flow Task: There were errors during task validation.
(Microsoft.DataTransformationServices.VsIntegration)
------------------------------
BUTTONS:
OK
------------------------------
We are in the process of converting an existing database to Unicode. Has anyone encountered any problems in doing this?
View 1 Replies View Related
Hi,
I am getting an issue when i try to run a package which was validated against an oracle database on windows with UTF8. When I try to run the same package(no changes, just changing the conenction parameters to point to an oracle database on UNIX with UTF16), the package fails with error saying cannot convert unicode to string for string columns.
The same run through fine if I refresh the metadata against the UNIX database, but then it doesnt run against the Windows database.
Can anyone please suggest how to overcome this scenario. My issue is, I need to run my package against various database(by just pointing the database connection details) without changing anything in the package.
Please suggest.
Thanks,
Manish
Hi,
I want to convert literal string to unicode before insert into the database. and after insertion i want to retrive this value from data base and convert back to literal string.
pls tell me how to incode and decode literal string to unicode and from unicode to literal string.
I am inserting date and time data into a SQL Server 2012 Express table from an application. The application is providing the date and time as a string data type. Is there a TSQL way to convert the date and time string to an SQL datetime date type? I want to do the conversion, because SQL displays an error due to the
My date and time string from the application looks like : 3/11/2014 12:57:57 PM
Is there any way to convert Unicode (NVarchar) to Ascii (Varchar)?
If I just use cast , the result will become ???.
Hi there.We have an application that can run on a non-unicode or a unicode sqlserverdatabase.Currently the application is running in a unicode database, as anon-unicode database is less than half the size, I would prefer tohave a non-unicode database for demo purposes to be on my laptop, etcetcIs it possible to change a unicode sql server 2000 database into anon-unicode database?And if so, how would I go about doing this?Any help would be greatly appreciated.ThanksRodger
View 2 Replies View RelatedSQL Native Client 2005.90.3042.00 ODBC driver does not return SQL_CVT_DOUBLE as part of the mask from SQLGetInfo for SQL_CONVERT_WCHAR, SQL_CONVERT_WVARCHAR even though driver actually supports converting nchar and nvarchar to SQL_DOUBLE. For example,
select
{ fn convert(N'1.23', SQL_DOUBLE) }
works, but
SQLUSMALLINT nInfoType = SQL_CONVERT_WCHAR;
SQLUINTEGER nInfoValue = 0;
SQLRETURN rc = SQLGetInfo( hdbc, nInfoType, &nInfoValue, sizeof( nInfoValue ), NULL );
ASSERT( nInfoValue & SQL_CVT_DOUBLE ); // fails
Hi,I have a text file that contains a date column. The text file will beimported to database in SQL 2000 server. After to be imported, I wantto convert the date column to date type.For ex. the text file look likeName dateSmith 20003112Jennifer 19991506It would be converted date column to ydm database in SQL 2000 server.In the table it should look like thisName DateSmith 2000.31.12Jennifer 1999.15.06Thanks in advance- Loi -
View 1 Replies View RelatedHi,
I am trying to access a date column up to millisecond precession. So I cast date to as follows:
Code BlockCONVERT(varchar(23),CREATE_DATE,121)
I get millisecond part as a result of query but it€™s €œ000€?.
When I try to test the format by using getDate instead of DateTime column I get right milliseconds.
CONVERT(varchar(23),GetDate(),121) --Gives right milliseconds in return
hi,
How do i convert a varchar field into the datetime data type? the reason i need this lies in the requirement that in the earlier data base the column that is hlding the date value is having the data type as varchar. and in the new design the column data type is datetime. i am using sql scripts for the data migration from the older design to the newer and got stuck with this datetime convertion issue. do let me know the best possible solution.
following are the sample data that is theer in the older table for the date.
12/12/2003
1/13/2007
01132004
1-1-2004
1.2.2001
there is no uniformity of the data that is stored currently.
thnkx in adv.
rahul jha
In my package , I am used CDC Source transformation and received the Net changes then insert into Destination. But whatever Data coming from CDC source data type Varchar value needs to Converting Non Unicode string to Unicode string SSIS. So used Data conversion transformation to achieved this.  I need to achieve this without data conversion.
View 3 Replies View RelatedI'm connecting to a SQL Server 2005 database using the latest (beta) sql server driver (Microsoft SQL Server 2005 JDBC Driver 1.1 CTP June 2006) from within Java (Rational Application Developer).
The table in SQL Server database has collation Latin1_General_CI_AS and one of the columns is a NVARCHAR with collation Indic_General_90_CI_AS. This should be a Unicode only collation. However when storing for instance the following String:
‚¬_£_ÙÚÜÛùúüû_ÅÆØåæøߣÇçÑñ_¼½¾_ЎўЄєÒ?Ò‘_прÑ?туф_ЂЉЊЋ
... it is saved with ? for all unicode characters as follows (when looking in the database):
‚¬_£_ÙÚÜÛùúüû_ÅÆØåæøߣÇçÑñ_¼½¾_??????_??????_????
The above is not correct, since all unicode characters should still be visible. When inserting the same string directly into the sql server database (without using Java) the result is ok.
Also when trying to retrieve the results again it complains about the following error within Java:
Codepage 0 is not supported by the Java environment.
Hopefully somebody has an answer for this problem. When I alter the collation of the NVARCHAR column to be Latin1_General_CI_AS as well, the data can be stored and retrieved however then of course the unicode specific characters are lost and results into ? So in that case the output is as described above (ie ‚¬_£_ÙÚÜÛùúüû_ÅÆØåæøߣÇçÑñ_¼½¾_??????_??????_????)
We would like to be able to persist and retrieve unicode characters in a SQL Server database using the correct JDBC Driver. We achieved this result already with an Oracle UTF8 database. But we need to be compliant with a SQL Server database as well. Please help.
Thanks in advance for your help.
I have a date filed 12/26/2006 and a time field 7:00am. How can I combine them in my select statement and get a DateTime field.
View 3 Replies View RelatedHello All,
In following statement in SQL, I'm first converting 'IssueDate' with style 101 into 'nvarchar' then converting to Datatime.
convert(datetime,convert (nvarchar,Cert_WarehouseDetails.IssuedDateX,101)) <= '3/29/2004')
Which is right in below one.
1. Do I need to first convert into nvarchar then datetime.
e.g. convert(datetime,convert (nvarchar,Cert_WarehouseDetails.IssuedDateX,101)) <= '3/29/2004')
2. Otherwise can I directly convert into datetime.
convert(datetime,Cert_WarehouseDetails.IssuedDateX ,101) <= '3/29/2004')
Please reply to me asap.
Regards,
M. G.
Hi,
Is there a way to convert the date time column to MM/DD/YY HH:MM AM/PM format.
I tried
Select Convert(varchar , Getdate(),100). But this is not in MM-DD-YY format..
Thanks in advance..
Hi all..its kinda hard for me hw to figure out this, hopefully any of u guys can help me out with this super simple problem..
here is my query..
select convert(char(50),dateadd(day,-7,getdate()),105)
its because i want it to look last week data. BUT i get the format like this '03-07-2006'
what i want is it to be like this '20060703' how do i do that?
Thanks,
Jack
I'm having trouble converting a date of birth field, datatype int from yyyymmdd to mmddyyyy.
select 'DOB' = Convert(char(10), pat_dob, 101) from patfile
what am I missing?
I have a table with an int field that I'm trying to
insert into a datetime field, however, there are 0's in the int field. How do I write a case statement to change the 0's to '01/01/1900' and then store the datetime field as 'mm/dd/yyyy'? The data is currently coming in as yyyymmdd as int.
Sample Data:
19720518
19720523
19720523
19720601
19720603
19720609
Hi guys and gals,
I've had some great headaches with SSIS this morning, which I have managed to get a workarounds for, but I'm not happy with them so I've come to ask for advice.
Basically, I am exporting data from an SQL Server database into an Excel spreadsheet and hitting issues with unicode and non-unicode data types.
For example, I have a column that is char(6) and have added a data conversion step to the data flow, which converts it to type DT_WSTR and then everything works!
However, this seems like a completely un-neccessary step as I should be able to do the conversion in T-SQL - but no matter what I try I keep getting the same problem.
SELECT Cast(employee_number As nvarchar(255)) As [employee_number]
FROM employee
WHERE forename = 'george'
ErrorValidation error. details: 1 [1123]: Column "employee_number" cannot convert between unicode and non-unicode string data types.
I know I have a solution (read: workaround) but I really don't want to do this everytime!
Any suggestions for what else to try?
I have SQL table with dateTime field which is INT type (This field contains a number representing DATE / TIME)
I would like to convert this umber to actuall date time output. However, SQL gives invalid date times. See below)
Appears the resulting date time are all the same.
SQL COMMAND
Select TimeStamp, cast(convert(TimeStamp,103) As datetime) from winsData2
OUTPUT
TimeStamp Converted TimeStamp
2147483647 1900-01-01 00:00:00.343 2147483647 1900-01-01 00:00:00.343 1178694066 1900-01-01 00:00:00.343 2147483647 1900-01-01 00:00:00.343 1178688211 1900-01-01 00:00:00.343 1178828143 1900-01-01 00:00:00.343 2147483647 1900-01-01 00:00:00.343
Any assitance appreciated.
Hi:
I have a column call Date_Sent (28/02/2004)(dd/mm/yyyy) format as varchar at beginning. I want to convert to other column as datetime.
I use Query like:
SELECT
CAST(SUBSTRING(Date_Sent,1,2)as int) + '/' +CAST(SUBSTRING(date_sent,4,2) as int) + '/' +CAST(SUBSTRING(DATE_SENT,7,4) as int)
From MyTable
It is not working, anybody can give me some advise!
thanks!
When I configure my SQL server datasource, what SQL statement can I use to convert a source field in a legacy DB2 database in 'mmddyy' format to a datetime field so that I can query by date on this field?
View 1 Replies View Related