Skip to main content

Posts

Showing posts from April, 2011

Separate Strings in SQL Server

During my Development i found a situation where i have to separate string on '|' basis  for acheiving this i wrote following small query


select
SUBSTRING(('KHI|108'),0,CHARINDEX('|',('KHI|108'))) City ,
REVERSE(SUBSTRING(REVERSE('KHI|108'),0,CHARINDEX('|',REVERSE('KHI|108')))) CityCode

Suppress zeroes on crosstab reports

For suppressing zeroes on Crosstab reports follow these steps:


1. Right click on the sum field and select "Format Field".
2. In the Format Field window click the "Customize" button.
3. In the Custom Style window click on the "Number" tab and check the box "Suppress if Zero".