Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Information only picked up to the comma
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Information only picked up to the comma

 Post Reply Post Reply
Author
mkbutler View Drop Down
Newbie
Newbie


Joined: 13 April 2007
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote mkbutler Quote  Post ReplyReply Direct Link To This Post Topic: Information only picked up to the comma
    Posted: 07 July 2007 at 3:56am
I have a database with a field called StudentName. The name is stored in the database as LastName, FirstName. I cannot change this field as I did not create the database and it is used with other programs. When the StudentName is displayed on the Internet in a Text Box, the field only displays up to the comma. For instance if the StudentName in the db is "Butler, Mona" only "Butler," is displayed on the Internet. What suggestions do you gurus have?
Back to Top
kbannon View Drop Down
Groupie
Groupie


Joined: 03 October 2002
Location: Ireland
Status: Offline
Points: 115
Post Options Post Options   Thanks (0) Thanks(0)   Quote kbannon Quote  Post ReplyReply Direct Link To This Post Posted: 07 July 2007 at 9:54am
You need to use two functions to get this:

Dim number_of_characters_to_the_comma
Dim myVariable
'find out where in the string the comma occurs
number_of_characters_to_the_comma = Instr(myVariable,",")

'get the left characters to that point
myVariable = Left(myVariable, number_of_characters_to_the_comma)


Edited by kbannon - 07 July 2007 at 9:55am
I don't suffer from insanity, I enjoy every minute of it.
Back to Top
mkbutler View Drop Down
Newbie
Newbie


Joined: 13 April 2007
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote mkbutler Quote  Post ReplyReply Direct Link To This Post Posted: 07 July 2007 at 3:20pm
That would allow me to pull out what occurs prior to the comma. I want the full field to display. For some reason all that is displaying is what is prior to the comma.
The database contains: Butler, Mona
The Internet is displaying: Butler,
I want: Butler, Mona
 
I am using Response.Write (object ("fieldName")). Why does this only show up to the comma?
Back to Top
kbannon View Drop Down
Groupie
Groupie


Joined: 03 October 2002
Location: Ireland
Status: Offline
Points: 115
Post Options Post Options   Thanks (0) Thanks(0)   Quote kbannon Quote  Post ReplyReply Direct Link To This Post Posted: 07 July 2007 at 9:18pm
If you are using Response.Write (object ("StudentName")) then it should display the contents of that field - both lastname & comma & firstname.
Are you sure its not being edited somewhere along the way?
How are the records pulled from the database? Could the SQL statement be dropping the firstname part?
I don't suffer from insanity, I enjoy every minute of it.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.