If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Number Format Field to Allow Text Value?
I have a number formatted fields that now needs to have text added to it.
if I convert it to a text field then the sort order changes from record 1, 2, 3, etc. to 1, 10, 11, 12 and so on since it is now looking at text values. is there a way to allow text at the end of the number value, but still keep it sorting in numeric order? Thanks! |
#2
|
|||
|
|||
You can sometimes use the Val() function against a mixed field to return the
numeric value of the leading numeric characters. For instance Val("123 Summit") = 123 Val("Summit 123") = 0 -- Duane Hookom MS Access MVP "Karl Burrows" wrote in message ... I have a number formatted fields that now needs to have text added to it. if I convert it to a text field then the sort order changes from record 1, 2, 3, etc. to 1, 10, 11, 12 and so on since it is now looking at text values. is there a way to allow text at the end of the number value, but still keep it sorting in numeric order? Thanks! |
#3
|
|||
|
|||
suggest you leave the number field as a number data type, and add a separate
field for the text values you need. in a query, you can concatenate the two fields so they show as one in the query dataset, as NumberAndText: [MyNumberField] & " - " & [MyTextField] hth "Karl Burrows" wrote in message ... I have a number formatted fields that now needs to have text added to it. if I convert it to a text field then the sort order changes from record 1, 2, 3, etc. to 1, 10, 11, 12 and so on since it is now looking at text values. is there a way to allow text at the end of the number value, but still keep it sorting in numeric order? Thanks! |
#4
|
|||
|
|||
For this very reason (sort order), I have sometimes maintained a field in two
ways: e.g. clauses 1, 1a, 2, 10, 10a clearly must be in that order, which may not be a text order. I keep, in one case, a separate field with the required sorted order. You can see, just as well as I can, that text sorts in text order, numerics in numeric order. You could sort on some mid$ (if you can identify it). What are you asking? For some inbuilt Access method which you know doesn't exist? Look at all the text manipulation functions to see what you can use. I dunno. Keep the number and put the text in a further field? (this appears to be Tina's suggestion, and nothing wrong with it just you have to invent some method to separate stuff, if you want to sort another way, clearly) Chris ;-) "Karl Burrows" wrote in message ... I have a number formatted fields that now needs to have text added to it. if I convert it to a text field then the sort order changes from record 1, 2, 3, etc. to 1, 10, 11, 12 and so on since it is now looking at text values. is there a way to allow text at the end of the number value, but still keep it sorting in numeric order? Thanks! |
#5
|
|||
|
|||
The field value would be something like 123b. Probably only 1 letter after
the number, so how would you recommend I use the VAL in the table to get it to sort correctly? Thanks! "Duane Hookom" wrote in message ... You can sometimes use the Val() function against a mixed field to return the numeric value of the leading numeric characters. For instance Val("123 Summit") = 123 Val("Summit 123") = 0 -- Duane Hookom MS Access MVP "Karl Burrows" wrote in message ... I have a number formatted fields that now needs to have text added to it. if I convert it to a text field then the sort order changes from record 1, 2, 3, etc. to 1, 10, 11, 12 and so on since it is now looking at text values. is there a way to allow text at the end of the number value, but still keep it sorting in numeric order? Thanks! |
#6
|
|||
|
|||
"Karl Burrows" wrote in message ... The field value would be something like 123b. Probably only 1 letter after the number, so how would you recommend I use the VAL in the table to get it to sort correctly? Thanks! Use a query sorted by the Val function. Select * from yourtable order by val([yourfield]) And you don't need to cross post to every newsgroup you can spell. People tend to be more willing to help you if you are courteous. |
#7
|
|||
|
|||
Sorry, I just didn't know which group would be most appropriate. I didn't
think I was cross-posting, just multi-group posting the same message thread. Some monitor particular groups and some others. Sorry! "Randy Harris" wrote in message ... "Karl Burrows" wrote in message ... The field value would be something like 123b. Probably only 1 letter after the number, so how would you recommend I use the VAL in the table to get it to sort correctly? Thanks! Use a query sorted by the Val function. Select * from yourtable order by val([yourfield]) And you don't need to cross post to every newsgroup you can spell. People tend to be more willing to help you if you are courteous. |
#8
|
|||
|
|||
"Karl Burrows" wrote in message
Sorry, I just didn't know which group would be most appropriate. I didn't think I was cross-posting, just multi-group posting the same message thread. That's what cross-posting is. Sure, it's better than multiposting, which is when you post a separate message to each group to ask the same question. But cross-posting to irrelevant groups is still frowned on. You shouldn't be looking for maximum saturation for your message, you should be looking to target it to the one or two groups where it is on topic. In this case, the .queries group would probably have been best, but I can understand how you might not realize it. The question is way off-topic for the .setupconfig group. -- Dirk Goldgar, MS Access MVP www.datagnostics.com (please reply to the newsgroup) |
#9
|
|||
|
|||
Yea, you are right. I just wasn't sure, but now I know. Thanks!
"Dirk Goldgar" wrote in message ... "Karl Burrows" wrote in message Sorry, I just didn't know which group would be most appropriate. I didn't think I was cross-posting, just multi-group posting the same message thread. That's what cross-posting is. Sure, it's better than multiposting, which is when you post a separate message to each group to ask the same question. But cross-posting to irrelevant groups is still frowned on. You shouldn't be looking for maximum saturation for your message, you should be looking to target it to the one or two groups where it is on topic. In this case, the .queries group would probably have been best, but I can understand how you might not realize it. The question is way off-topic for the .setupconfig group. -- Dirk Goldgar, MS Access MVP www.datagnostics.com (please reply to the newsgroup) |
#10
|
|||
|
|||
Dirk,
You mentioned a queries newsgroup, could tell me link to it? I can't seem to find it. Thanks. -- JoeCL LACO-CAO "Dirk Goldgar" wrote: "Karl Burrows" wrote in message Sorry, I just didn't know which group would be most appropriate. I didn't think I was cross-posting, just multi-group posting the same message thread. That's what cross-posting is. Sure, it's better than multiposting, which is when you post a separate message to each group to ask the same question. But cross-posting to irrelevant groups is still frowned on. You shouldn't be looking for maximum saturation for your message, you should be looking to target it to the one or two groups where it is on topic. In this case, the .queries group would probably have been best, but I can understand how you might not realize it. The question is way off-topic for the .setupconfig group. -- Dirk Goldgar, MS Access MVP www.datagnostics.com (please reply to the newsgroup) |
|
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Syntax for Number format in the Text Form Field Options | Ed Hall 61 | General Discussion | 3 | May 8th, 2005 07:51 PM |
Query for 'confirmation' | rogge | Running & Setting Up Queries | 8 | April 19th, 2005 03:26 PM |
Combo Box & Text Box | AccessRookie | Using Forms | 3 | April 6th, 2005 11:33 PM |
Access reports with a horizontal line after each record??? | Bill via AccessMonster.com | Setting Up & Running Reports | 6 | March 9th, 2005 04:51 PM |
Design help, please | SillySally | Using Forms | 27 | March 6th, 2005 04:11 AM |