473,398 Members | 2,427 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

zero filling

example of the dataGR1972.267/3069 I need to zero fill after the first period so the data looks like Gr1972.0267/3069. Can anyone help me
Jul 27 '07 #1
1 1544
ck9663
2,878 Expert 2GB
example of the dataGR1972.267/3069 I need to zero fill after the first period so the data looks like Gr1972.0267/3069. Can anyone help me

try


declare @stringvar as varchar(15)

set @stringvar = 'GR1972.267/3069'

select substring(@stringvar,1,patindex('%.%',@stringvar)) + '0' +substring(@stringvar,patindex('%.%',@stringvar)+1 ,len(@stringvar))
Jul 27 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Steve | last post by:
Is there a way in PHP to zero fill an integer to a specified length? For instance, if I have a two digit number, and I want to zero fill it to four digits, is there a PHP function I can use? Or do...
6
by: Andrey | last post by:
What does the standard say about zero-initializing of static structures/classes, specifically: is it guaranteed by the standard that the alignment fillers between the members will also be...
13
by: simondex | last post by:
Hi, Everyone! Does anyone know how to initialize an int array with a non-zero number? Thank You Very Much. Truly Yours, Simon Dexter
2
by: hennakapoor | last post by:
How do the form filling software determine which text field gets what data i.e. a typical form filling software will ask the user to enter the username / address / password etc. Whenever it goes to...
2
by: Steve | last post by:
I have a database where I want to use an autonumber field to make SKUs for a new product when it is entered. Is there a way I can make the field zero fill to a certain length? For instance, if I...
26
by: 69dbb24b2db3daad932c457cccfd6 | last post by:
Hello, I have to initialize all elements of a very big float point array to zero. It seems memset(a, 0, len) is faster than a simple loop. I just want to know whether it is safe to do so, since I...
1
by: John Smith | last post by:
I have a two dimentional char array. Before filling it using strtok(), I reset its elements to '\0' using two nested for loops. The code works as I hope it would but I wonder whether I really need...
3
by: crjunk | last post by:
I have a 3 table in my DataSet that I'm filling with data. After I've filled these 3 tables, I'm then trying to run a query that will fill a 4th table in the DataSet with data from the three...
4
by: simchajoy2000 | last post by:
Hi, I have a form containing a datagrid where users can enter in their specified information for each row and column. Behind the scenes I have a sub which handles datagrid.CurrentCellChanged...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.