Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / what command do i need to do this

Author
Message
chester
21
Years of Service
User Offline
Joined: 11th May 2003
Location: United Kingdom
Posted: 13th May 2003 02:09
hello, i have a integer of about 10 numbers long, how can i chop it down so all i have is the fist three numbers, i know its probably easy but i been racking my brains for about an hour now thanks
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 13th May 2003 02:25
Easy.

A=987654321
B=A/1000000

Now B will be 987.

BTW, 10 digits may be a bit long for a standard integer. Try this and see what I mean.

A=9876543210
print A
wait key
chester
21
Years of Service
User Offline
Joined: 11th May 2003
Location: United Kingdom
Posted: 13th May 2003 02:27
thanks i`ll give it a go

andrew11
21
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 13th May 2003 02:56 Edited at: 13th May 2003 02:56
You could also do something like:



With mine, you can also use MID$() or RIGHT$().

"All programmers are playwrites and all computers are lousy actors" -Anon
chester
21
Years of Service
User Offline
Joined: 11th May 2003
Location: United Kingdom
Posted: 13th May 2003 21:26
thanks they both work

Login to post a reply

Server time is: 2024-09-20 07:42:38
Your offset time is: 2024-09-20 07:42:38