Wrox Programmer Forums
|
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 7th, 2007, 05:45 AM
Authorized User
 
Join Date: Sep 2006
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default help plz

Hi all,
 I have 2 columns as maxDistance and minDistance with datatypes decimal(18,2).their values are stored in datatbase as 23.00 60.00.i have a column in grid as distanceRange where i have to show my range as 23:60.so can u plz guide me in solving this.

 
Old August 7th, 2007, 08:09 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hi there.. I don't know the database you are using, but this sound rather simple solved by the underlying query...just concat the 2 fields in your query the way you want...

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
 
Old August 7th, 2007, 09:24 AM
Friend of Wrox
 
Join Date: Feb 2006
Posts: 133
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to gaurav_jain2403
Default

Use following query:

Select CONVERT(int,minDistance) + ':' + CONVERT(int,maxDistance) from tableName
 
Old August 8th, 2007, 12:46 AM
Friend of Wrox
 
Join Date: Aug 2006
Posts: 231
Thanks: 0
Thanked 1 Time in 1 Post
Default

first use split method to get 23 out of 23.00 and 60 from 60.00 in two variables then combine them and show in grid.
if you still required code post again

thanks......
 
Old August 8th, 2007, 06:41 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Quote:
quote:Originally posted by MunishBhatia
 first use split method to get 23 out of 23.00 and 60 from 60.00 in two variables then combine them and show in grid.
if you still required code post again

thanks......
except that there is no native Split() function in TSQL (SQL Server, Access) which would require the original poster to find a split() function on the net and add it to their database, etc.

gaurav_jain2403's solution is the most straight forward way to do this.



================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for:
Professional Search Engine Optimization with ASP.NET

Professional IIS 7 and ASP.NET Integrated Programming

================================================== =========
 
Old August 10th, 2007, 12:29 AM
Authorized User
 
Join Date: Sep 2006
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi

  Gaurav,

        Thanks a lot. your trick works great!!!!

 
Old August 10th, 2007, 02:28 AM
Friend of Wrox
 
Join Date: Aug 2006
Posts: 231
Thanks: 0
Thanked 1 Time in 1 Post
Default

gourav
i did not understand yours comment on split function under my solution.
Please explain it.

thanks......





Similar Threads
Thread Thread Starter Forum Replies Last Post
plz.....plz solve out my problem.... kethireddy435 ASP.NET 1.x and 2.0 Application Design 1 October 4th, 2007 12:56 PM
plz tell me flowertear Pro Visual Basic 2005 2 November 28th, 2006 08:30 PM
Plz help me ritesh_ch23 Pro JSP 1 July 18th, 2006 10:46 PM
Plz plz someone help beetle_jaipur CSS Cascading Style Sheets 3 March 26th, 2006 05:37 AM
Help me plz waqaraziz VB.NET 2002/2003 Basics 1 March 19th, 2005 04:40 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.