Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ASP / Database Access / January 2006



Tip: Looking for answers? Try searching our database.

displaying a only part of a field along with other fields of a recordset

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
shripaldalal - 21 Jan 2006 16:52 GMT
hi all,

i have the following fields....

Document_Name, Document_No, Document_Date, Order_No, Order_Date,
Peripheral

The first 5 you can understand, peripheral is a memo field which
contains all less important (but important!) details like Address1,
Address2, Place_Of_Delivery in a comma delimited string such as:

Address1:Princess Street;Address2:Mumbai;Place_Of_Delivery:Bhiwandi;

I have already done something like this

select document_no, document_date, order_no, order_date,
getperipheral(Place_Of_Delivery) as Delivery_Place from mastertable

then getperipheral(Place_Of_Delivery) i replace with mid(peripheral,
instr(peripheral, 'Place_Of_Delivery') + 17, instr(instr(peripheral,
'Place_Of_Delivery'), peripheral, ';') - instr(peripheral,
'Place_Of_Delivery') - 17)

so i sql looks like

select document_no, document_date, order_no, order_date,
getperipheral(Place_Of_Delivery) i replace with mid(peripheral,
instr(peripheral, 'Place_Of_Delivery') + 17, instr(instr(peripheral,
'Place_Of_Delivery'), peripheral, ';') - instr(peripheral,
'Place_Of_Delivery') - 17) as Delivery_Place from mastertable

This method also works fortunately but there is only one huge
problem....

if place of delivery is not there at all.... and peripheral field is
blank.....then the ENTIRE RECORD DOES NOT SHOW UP OR THERE IS AN
ERROR.......is there any inbuilt function in access that can do
this.....this is a night mare.......

thanks,
shripal dalal.
AnthonyWJones - 21 Jan 2006 21:00 GMT
Is there any chance you can influence the designer of the DB to stop doing
that.

Give each piece of 'important' data it's own field.

> hi all,
>
[quoted text clipped - 37 lines]
> thanks,
> shripal dalal.
Bob Barrows [MVP] - 21 Jan 2006 21:23 GMT
> if place of delivery is not there at all.... and peripheral field is
> blank.....

You are describing two separate situations here, I think. Instead of
describing the situation, could you show us a few rows of sample data that
illustrate the problem?

> then the ENTIRE RECORD DOES NOT SHOW UP OR THERE IS AN
> ERROR.......is there any inbuilt function in access that can do
> this.....this is a night mare.......

You can use the iif function in your query to handle the case where
Peripheral contains Null:

..., iif(Peripheral IS Null, '', <your code to parse Peripheral>)

However, I would prefer to handle this field in my vbscript code. This task
is child's play using Split.

Actually, I would prefer to send this database back to its designer and tell
him to apply proper database design techniques to it.

Bob Barrows
Signature

Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

shripaldalal - 27 Jan 2006 10:08 GMT
dear bob,

thanks a lot......it worked like a charm! thanks again!

best regards,
shripal dalal.

> > if place of delivery is not there at all.... and peripheral field is
> > blank.....
[quoted text clipped - 24 lines]
> don't check it very often. If you must reply off-line, then remove the
> "NO SPAM"
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.