Hi All,
I have a serial number field in table. Field type is integer. It is just stored as 1,2,3,12,13, etc.
It is showing as 00001,00002,00003,00012,00013 in interface. C# string format is very easy to changed the format.
But when i export to excel there is a problem. Let me know how to format string in SQL and export to excel.
Thanks
Aung
I have created SSRS report which has many overlapping objects, the output in PDF format seems to good but in word format it is not giving the required output.
I have date coming to one page as a string in the following format"May 4 2005 12:00AM" I need to query one of my tables using this date in combination of other nondate values. How can I convert this date into valid sql server datetime format before I query a database tables Please help
I have a table which stores date-of-birth in varchar 19861231(yyyymmdd). A view takes this data. I want to store this date as mmddyyyy in the view. How can we achieve this?
I have a set of csv files and a set of Format Specification files for each of the csv files. I need to convert the csv files into another format of csv files as specified in the Format Specification files. All the columns of the input csv files do not have a mapping with the columns of the output csv files. How can I achieve this using SSIS ? This is an urgent requirement. Please reply asap. Thanks.
I am stuck at one place, where I have to convert CSV format file data into SAP IDOC format file. In SSIS we don't have any such SAP adapter (though we have .NET Data Provider for mySAP suite [SSIS SAP Adapter] but this is still not fully supported by Microsoft, plus it doesn't have feature to convert data into IDOC format) that can do this. Can someone here please provide me some pointers on any third party adapters available in market to do this job or if anyone has already developed some custom approach to achieve this task?
Your quick response on this is highly appreciated.
dear all can anybody help me soon.... i am using visual studio 2005 webapplication based on sql server 2005 database. i can get one date from sql using one query. I am selecting my field based on following code CONVERT(varchar, Oman.Positions.Datum, 9) AS LastUpdate this case my output is May 4 2008 3:19:45:000AM..... this output is correct but from this output i want to avoid millisecond part. ie i want the output like May 4 2008 3:19:45 AM.... how i can do this regards
E.g, i have a store procedure. The start date is long date (4/15/2007 3:00pm). i want to select the start date with a particular date (short date format 4/15/2006). Thanks in advance.
I have a table that has a DATE field named. AccountingDate that is in the format YYYY-MM-DD. It's not a VARCHAR field. I simply want to convert this date field into the format MM/DD/YYYY and call it New_Accounting_Date.
I've played with various combinations of CAST & CONVERT but haven't been able to get it to work.
Below is my latest effort which returns the error:
Incorrect syntax near the keyword 'as'
What code would work to return a MM/DD/YYYY value for New_Accounting_Date?
Select GLBATCH.AccountingDate, convert(GLBATCH.AccountingDate as date),101) AS New_Accounting_Date from GLBATCH
I am trying get my VB6 application to insert a record into a table (SQL Express) which has a datetime column but it would not process if the data format is differ to *American Date format*.
The date() function in VB returns 15/11/2006 which is in Australian Date format (DD/MM/YYYY) according to my setting in "Reginal and Lanuage Option-> Locale 0> English (Australia)" setting.
I get the following error:
Msg 242, Level 16, State 3, Server KITSQLEXPRESS, Line 1 The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. The statement has been terminated.
My computer's locale is set to English (Australia) and I expect the datetime format would follow what is set in system locale
I've read an article somewhere on the net about how SQL 2005 eliminate the confusion of date conversion when read/write datetime records into a table...but it seems to me that it is still as in-flexible as MS Access
Is there a setting in the database that takes care of it?
I have a column date in my database which I should send it to Oracle database. The Date format in Oracle is number. I don’t know how should I convert the date to that format? Example : SQL FormatOracle Format 02/16/05 105046
hi siri have table hh .it has two columnsone is hhno is integer datatype another hhdoc is xml data type likehh tablehhno hhdoc---------------------------------------------------------------------------------------------100<suresh>sfjfjfjfjf</suresh>....................................101<ramesh>hhfhfhf</ramesh>..................................how to convert the xml data format into the general data format plshelp me with examples
i am trying to bcp a data file to a sql table that have diffn formats. the conds are as follows -
1]the last 2 columns of the table need to be omitted 2]the first 2 fields of the data file correspond to the first 2 coulmns of the table and need to be imported 3]the last 2 fields of the data file need to be ommitted
I have access as front end, and sql server as backend, now i need create a query to get some data that user want. But they want CSV format, what is that? After i retrieving the data, how to save to CSV format. Thanks.
Hi! I am importing some social security numbers and federal ID numbers into my database. When I do, I lose the dashes in the social and federal ID's. Is there anyway to format them after I have imported them or is there a way to make the dashes stay in excel.
Is there a way in RS2005 to create a UDF that will take an XML field as an input, and display the XML formatted (similar to how IE formats XML files, structured, but without the need to expand/collapse sections).
Right now I can display the XML data from the field in a textbox, but it displays as one continuous string, rather than nicely structured for viewing.
SQL Database with column cell-phone formatted 1234567890. I want to display it (123) 456-7890. I use the following to display it as 1234567890: <%# Directory.FieldValue("cell_phone", Container) %> I tried the following code but get a formatting error: <%# Double.Parse(Directory.FieldValue("cell_phone", Container)).ToString("(###) ###-####") %> What stupid error am I making?
Hello!I inserted data to dbase, but I soon got error message.. Europien date format is dd.mm.yyyy So I get date from text box:<asp:textbox id="date" style='Z-INDEX: 102; LEFT: 411px; POSITION: absolute; TOP: 42px' runat='server' Width='185px' Height='22px'>Date</asp:textbox>Date which is get as string is inserted to dbase by code behind:string insert = "INSERT INTO tbl_UFD_PlanPremier (DAT_Prem) VALUES ('"+date.Text+"')";I thought that that will work ok, but.. By date 1.1.2006 was everithing ok, problems begann with 30.5.2006 - I get error message: failed to convert char data type to smalldatetype.I was seeking for reason and I found out that date in SQL database is saved in format dd.mm.yyyy but string which is inserting by ASP function:ExecuteNonQuery() into dbase has format mm.dd.yyyy - when I wrote to textbox date 5. 30. 2006, it passed allrightIs there any help? like how to change date format? Thanks
Hello all, I'm trying to write a query against an exisiting table that i can't modify and i'm running into a bit of a problem. The table stores timestamps as a char field instead of a datetime. So, i've had to use the CONVERT function to change it to a datetime during my query. A sample is below: SELECT convert(datetime, logged, 120) FROM AP200310 This works, except i want to include the option of querying a single day. Since the data that is returned is in this format: 12/12/2006 6:54:15 PM The following sql statement doesn't work:SELECT convert(datetime, logged, 120) FROM AP200310 WHERE logged = '12/12/2006' Thanks in advance for any help.
Hi everybody.Here's my Product tableID int,Title nvarchar(50),Price moneyHow can I get value from price field like thisIF PRICE is 12,000.00 it will display 12,000IF PRICE is 12,234.34 it will display 12,234.34Thanks very much...I am a beginner. Sorry for foolish question
Hi, I wanted to take a date from my Sql server. it is save as dd/mm/yyyy. but when i use the select command it return me dd-mm-yyyyT00:00:00.0000000+08:00. i try to use this following code but it is not working....thedate = String.Format("{0:dd/MM/yyyy}", (reader.GetSqlDateTime(1))) here is my complete codePublic Function deleteOrder(ByVal oid As Integer) As String conn = dbCon.getConnection() Dim cmd1 As New SqlCommand Dim reader As SqlDataReader Dim valid, sendDate, sd As String Dim thedate As String Dim cancelPeriod As String = CStr(System.DateTime.Today.AddDays(+3))
If Not reader.HasRows Then valid = "No match found" Else If reader.Read Then
'String.Format("{0:dd/MM/yyyy}",(dr.GetSqlDateTime(1))); thedate = String.Format("{0:dd/MM/yyyy}", (reader.GetSqlDateTime(1))) 'sd = reader("orderSendDate").ToString 'sendDate = sd.Substring(0, 10) conn.Close() End If End If 'Return errMsg If thedate = Convert.ToDateTime(cancelPeriod) Or thedate < CStr(System.DateTime.Today.AddDays(+3)) Then valid = "You are not allowed to change" Else Try conn.Open() Dim strUpdate As String Dim cmd As New SqlCommand strUpdate = "update orders set orderStatus = @os where orderID = @oid" cmd.Parameters.Add("@os", "c") cmd.Parameters.Add("@oid", oid)
cmd.CommandText = strUpdate cmd.Connection = conn cmd.ExecuteNonQuery() conn.Close() valid = "Cancellation succesful" updateOrderItemStatus(oid) Catch ex As Exception 'Response.Write(ex.Message) errMsg = ex.Message conn.Close() End Try End If
Return valid End Function
When i call my web method it gives me an error saying that page is not found... please teach me how to convert it. thx
I am using sql server 2000 and want to know how to get xml out of the database that looks like this using for xml auto <Clients> <Client ID="1"> <Employer="Company1" /> <Employer="Company2" /> <Contact type="phone"> <contact type="email" value="test@test.com"> <contact type="phone" value="555-5555"> </Client> <Client ID="2"> <Employer="Company3" /> <Employer="Company4" /> <Contact type="phone"> <contact type="email" value="test@test.com"> <contact type="phone" value="555-5555"> </Client></Clients> The problem I am having is that Contact is nested inside employer when I select Employer before Contact and the opposite happens when I select Contact first. They both join to the Client table so I would assume they both should nest directly under Client. How do I get different fields to nest directly under the same element like above?
I have installed the trial version of windows server 2003 on the second hard drive on my computer. I set up IIS and ran my website on it but the problem is when I do something on the site, which has a sql insert statement regarding datetime.now it says, "conversion failed when converting datetime from character string"
I think it's to do with the clock on server 2003, the format is like: 11/07/2007 2:39:59 a.m. I think it should be in format AM and not a.m. Any ideas on how to change the time format on a computer?
Or should I just change the Columns in my table to a Nvarcher value or something?
hello everyone...,i have problem in money format...i have moneytable is containning: userid money A 20000,0000 B 40000,0000userid type varchar(50)money type money i have store procedure like this:ALTER PROCEDURE [dbo].[paid]( @userid AS varchar(50), @cost AS money, @message as int="1" output)ASbegin transactiondeclare @money as money select @money = moneyfrom moneytablewhere userid=@useridif (@money > @cost)beginset @money = @money - @costUPDATE moneytable SET money = @money WHERE userid=@useridset @message ='1'endelsebeginset @message = '2' endCOMMIT TRANSACTION when i execute this procedure. i insert value to userid Acost 100,0000 it can not decrease, because cost 100,0000 is same with 1000000, why is like that?i want cost 100,0000 is same with 100. how can i do that? thx...
I have a urgent need for a date format.I have a third part tool which inserts date into the database in the format ( 7/1/2007 ) but what i want to display is 07/01/07).Kindly suggest fast as I have to put this to production shortly.Thanks
I have a written a stored procedure and excecuting it and displaying it in gridview(ASP.NET). I am getting Birthdate in the form of 8/23/1956 12:00:00 AM. I just need 8/23/1956. I have defined it as smalldatetime in stored procedure. How can I get it in that format ? HELP.........