Hi I have the below paragraph in my datacolum called 'Description'
Ansmann Powerline 5 Super Fast Charger, Microprocessor controlled desktop charger with discharge function for up to 5 NiCd/NiMH cells, For all NiCd and NiMH rechargable batteries including AA/AAA/C/D/9V, Negative Delta V control, faulty cell detection, defined predischarge, trickle charge, separate status indicator for every charging slot, ultra rapid charging, 230V AC. For UK use. Price for 1 Charger.
How do I take only the sentence upto the first comma in my STORED procedure
IN ACCESS UPDATE 14_Together_final_ICNs INNER JOIN 14_Together_UniqueSKUs ON [14_Together_final_ICNs].SKU = [14_Together_UniqueSKUs].SKU SET [14_Together_final_ICNs].sku_desc = [14_Together_UniqueSKUs].NewDesc WHERE (((Trim(Nz([NewDesc])))<>""));
THIS IS WHAT I TRY IN SQL SEVER BUT GET A DIFFERNET RESULT
UPDATE [14_Together_final_ICNs] SET sku_desc = [14_Together_UniqueSKUs].NewDesc FROM [14_Together_final_ICNs] INNER JOIN [14_Together_UniqueSKUs] ON [14_Together_final_ICNs].SKU = [14_Together_UniqueSKUs].SKU WHERE (RTRIM(LTRIM([14_Together_final_ICNs].sku_desc))<> N'')
I have a table with a keyword field. In this keyword field some of the entries have a space before the word and some don't. How can I remove all of the spaces from the fields that have them and not trim from the ones that don't.
I’m trying to optimize the following view so that it runs faster and to trim the code where possible. It runs for 1:57mins. Is that good or it can run much faster than that? Where do l start? It’s a view for a report. Please help l’m running on SQL 2000
CREATE View SalesTest AS SELECT dbo.Loan.loan_No AS [Loan No], dbo.Customer.customer_No AS [Customer No], dbo.Customer.first_Name + ' ' + dbo.Customer.surname AS Customer, dbo.Employer.employer_Name AS [Employer Name], dbo.Loan.store AS [Store No], dbo.Store.store_Name AS Store, dbo.Region.region_Description AS Region, dbo.Financier.financier_Short + dbo.Term.term_Description AS Product, dbo.Loan.date_Issued AS [Transaction Date], dbo.Loan.capital_Amount AS [Capital Amount], dbo.Loan.interest_Amount AS [Interest Amount], dbo.Loan.interim_Interest_Amount AS [Interim Interest Amount], dbo.Loan.interest_Amount + dbo.Loan.interim_Interest_Amount AS [Interest2 Amount], dbo.Loan.insurance_Amount AS [Insurance Amount], dbo.Loan.admin_Fee AS [Admin Fee], dbo.Loan.total_Amount AS [Total Amount], dbo.Loan_Type.loan_Type_Description AS [Loan Type Description], dbo.Loan.user_Changed AS [User], dbo.Loan.first_Payment AS [First Payment], dbo.Loan.monthly_Payment AS [Monthly Payment], dbo.Loan.repayment_Period AS [Repayment Period], dbo.Loan.outstanding_Amount AS [Outstanding Amount], dbo.Loan.last_Payment_Date AS [Last Payment Date], dbo.Status.status_Description AS Status, CONVERT(Char(3), dbo.Loan.loan_No, 1) AS Company, dbo.Customer.physical_Address1 AS Mine1, dbo.Customer.physical_Address2 AS Mine2, dbo.Customer.physical_Address3 AS Mine3, dbo.Loan.maturity_Date AS [Maturity Date], dbo.Agent.agent_Short AS Agent, dbo.Financier.financier_Short AS Financier, dbo.Loan.product AS [Loan Product], dbo.Deduction_Detail.teba_Account_No AS [Teba Account No] FROM dbo.Loan INNER JOIN dbo.Customer ON dbo.Customer.customer_No = dbo.Loan.customer_No INNER JOIN dbo.Status ON dbo.Status.status = dbo.Loan.status INNER JOIN dbo.Store ON dbo.Store.store = dbo.Loan.store INNER JOIN dbo.Product ON dbo.Product.product = dbo.Loan.product INNER JOIN dbo.Product_Type ON dbo.Product_Type.product_Type = dbo.Product.product_Type INNER JOIN dbo.Financier ON dbo.Financier.financier = dbo.Product_Type.financier INNER JOIN dbo.Term ON dbo.Term.term = dbo.Product.term INNER JOIN dbo.Employer ON dbo.Employer.employer = dbo.Customer.employer INNER JOIN dbo.Region ON dbo.Region.region = dbo.Store.region INNER JOIN dbo.Loan_Type ON dbo.Loan_Type.loan_Type = dbo.Product_Type.loan_Type INNER JOIN dbo.Agent ON dbo.Agent.agent = dbo.Product_Type.agent INNER JOIN dbo.Deduction_Detail ON dbo.Loan.customer_No = dbo.Deduction_Detail.customer_No AND dbo.Loan.deduction_No = dbo.Deduction_Detail.deduction_No WHERE (dbo.Loan.outstanding_Amount <> 0)
I have a table that has first & last name fields. They're each 20 bytes long. I would like to remove the trailing blanks from the fields and have just null following the data .. Is that possible ? Then when I send the file to someone, they won't have to strip out blanks when combining the names together.
OR 2nd choice ... Create a temporary work file and copy the data without trailing blanks to the new work file.
I've looked at RTRIM, but can't seem to get it right.
This is a very weird issue, and I can't seem to pinpoint the actual cause. I have a dynamic expression for Excel files that gets evaluated at run-time. One of the parameters for creating this path is pulled from the database - the column is nvarchar(10) and most of the values are only 2-characters long. I have tried LTRIM(RTRIM()) inside SQL Server as well as TRIM() in SSIS's Expression Editor, but nothing seems to work. At run-time the package fails, and the error I receive is because the value that gets pulled from the DB has trailing spaces. What's even annoying is the package runs fine on my XP machine, but fails on a W2K3 box - both setups are using the same back-end database.
Is this is a bug, or am I just screwing up something unknowingly? Thanks.
I cannot believe that there is yet another version of SQL Server without a TRIM function. So for SQL 2005 (like I've done in 7.0 and 2000) my T-SQL will look like dog poo because I will have to write LTRIM(RTRIM(MyValue)) anytime I want to remove whitespace from both ends of character values instead of just writing TRIM(MyValue).
I have values in a matrix takin too much space. Since they are just used as the matrix column header, cant i trim it or something. To display just the first 3 letters of the the attribute, and not the whole string? Whats the code for that?
=Fields!Collision_Type.Value thats my field right now.