UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Set Data Type For Expression, Office 2003    
 
   
EssKayKay
post Jul 6 2011, 09:31 AM
Post #1

UtterAccess Guru
Posts: 509
From: NE Wisconsin



Hello,

I want to sort a text field as if it was formatted as number. Is it possible to set the Data Type of an expression in a query? What I mean here is I have a field (Notice_ID) formatted as text that I want to remove the first two characters leaving the remaining number values only. Then I could sort based on numbers.

As an example, in my query I created an expression Notice_NO: mid([Notice_ID],3)

Notice_ID Notice_NO
R-1 1
R-22 22
R-117 117
R-244 224

Any suggestions would be appreciated.

Thanks,
SKK
Go to the top of the page
 
+
RAZMaddaz
post Jul 6 2011, 09:36 AM
Post #2

UtterAccess VIP
Posts: 6,170
From: Bethesda, MD USA



Try the following: Notice_NO: Cint(mid([Notice_ID],3))

This converts the text to an integer.
Go to the top of the page
 
+
EssKayKay
post Jul 6 2011, 09:42 AM
Post #3

UtterAccess Guru
Posts: 509
From: NE Wisconsin



Excellent - that did it.

Thank you,
Steve K.
Go to the top of the page
 
+
RAZMaddaz
post Jul 6 2011, 09:45 AM
Post #4

UtterAccess VIP
Posts: 6,170
From: Bethesda, MD USA



(IMG:style_emoticons/default/thumbup.gif)

Awesome, glad I could help!!!

RAZMaddaz
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 20th May 2013 - 08:38 AM