-
Jul 4th, 2014, 03:35 AM
#1
Thread Starter
Frenzied Member
[RESOLVED] format string to number
I have this field of varchar with values 00001, 00002, 00003, to 01000
With that, I want to get the value of the last number which is 1000. How will I do that?
-
Jul 4th, 2014, 03:49 AM
#2
Re: format string to number
So you have numbers saved as strings but want to return them as numbers?
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Jul 4th, 2014, 03:51 AM
#3
Thread Starter
Frenzied Member
Re: format string to number
yes. I am wondering if the right sql statement is last or max if it will work for varchar type.
-
Jul 4th, 2014, 03:54 AM
#4
Re: format string to number
Originally Posted by codesearcher
yes. I am wondering if the right sql statement is last or max if it will work for varchar type.
What is 1000? Is that a field id or a field value?
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Jul 4th, 2014, 03:56 AM
#5
Thread Starter
Frenzied Member
Re: format string to number
Originally Posted by Nightwalker83
What is 1000? Is that a field id or a field value?
that is a value of varchar type
-
Jul 4th, 2014, 04:22 AM
#6
Re: format string to number
Can you please upload the database? I am having a hard time trying to picture what you want.
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Jul 4th, 2014, 04:34 AM
#7
Thread Starter
Frenzied Member
Re: format string to number
Originally Posted by Nightwalker83
Can you please upload the database? I am having a hard time trying to picture what you want.
Nightwalker, can I ask this question anyway.
1. Can sql MAX query, still get the highest value even if the number is on a varchar field type?
2. If the record will reach millions, can sql max query handle that record and still have good performance to return the result?
-
Jul 4th, 2014, 06:14 AM
#8
Re: format string to number
Originally Posted by codesearcher
Nightwalker, can I ask this question anyway.
1. Can sql MAX query, still get the highest value even if the number is on a varchar field type?
2. If the record will reach millions, can sql max query handle that record and still have good performance to return the result?
Yes, SQL shouldn't have any problem with doing that as far as I know.
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Jul 4th, 2014, 06:56 AM
#9
Re: format string to number
Originally Posted by codesearcher
Nightwalker, can I ask this question anyway.
1. Can sql MAX query, still get the highest value even if the number is on a varchar field type?
2. If the record will reach millions, can sql max query handle that record and still have good performance to return the result?
1: Yes
2: Yes so long as the field is properly indexed
-
Jul 4th, 2014, 07:01 AM
#10
Thread Starter
Frenzied Member
Re: format string to number
-
Jul 4th, 2014, 10:42 AM
#11
Re: [RESOLVED] format string to number
Just an observation, wouldn't it have been quicker to actually try it then raise a thread here if you had problems?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|