473,387 Members | 1,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

querying specific information

This is the code for extracting from a memo the weight of each product.
Expand|Select|Wrap|Line Numbers
  1. Shipping (Package) Weight: Mid([Technical],InStr(1,[Technical],"kg [",1)+2,Len([Technical])-(InStr(1,[Technical]," lb]",1)-9))
However, for some reason, and I'm no expert. The code is not extracting just the weight. it keeps pulling other information.

[0.07 lb]
Product Width: 26.00 mm [1.02 in]
Battery Type: Alkaline
Voltage: DC 4.5V

Can anyone help?

I don't need Product width, Battery type and/or voltage
May 3 '10 #1

✓ answered by MikeTheBike

Hi

I could be missing something, but would this do it?
Expand|Select|Wrap|Line Numbers
  1. Shipping (Package) Weight: Mid([Technical],InStr(1,[Technical],"kg [",1)+2,(InStr(1,[Technical]," lb]",1)+3)-(InStr(1,[Technical],"kg [",1)+2))
Or somethink like it !

MTB

5 1221
MikeTheBike
639 Expert 512MB
Hi

I could be missing something, but would this do it?
Expand|Select|Wrap|Line Numbers
  1. Shipping (Package) Weight: Mid([Technical],InStr(1,[Technical],"kg [",1)+2,(InStr(1,[Technical]," lb]",1)+3)-(InStr(1,[Technical],"kg [",1)+2))
Or somethink like it !

MTB
May 4 '10 #2
It works! Thank You! Thank You!

Now...Its still showing a single bracket in front of the pounds. How do I remove this as well?

[0.07 lb
May 4 '10 #3
NeoPa
32,556 Expert Mod 16PB
Try changing the +2s to +4s :
Expand|Select|Wrap|Line Numbers
  1. Shipping (Package) Weight:
  2.   Mid([Technical],InStr(1,[Technical],'kg [',1)+4,(
  3.   InStr(1,[Technical],' lb]',1)+3)-(
  4.   InStr(1,[Technical],'kg [',1)+4))
I've added lines for display purposes. You can remove these to use in your database.
May 4 '10 #4
Hi,

that works, too, as well.

If a product does not have a weight, can the script by pass the item, and move to the next one?

Thanks
May 4 '10 #5
NeoPa
32,556 Expert Mod 16PB
Yes. Use IIf() in your formula.
May 4 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: stephane_husser | last post by:
My company is currently investigating in several database, projects tracking software. Being a beginner, I would like to know if you could provide me some support concerning the capabilities of...
0
by: Stefan Engstr?m | last post by:
My mysql is responding strangely to a select when I try to ask for particular columns instead of everything. Here is an example which is querying a database of a few thousand elements in each...
2
by: Muscha | last post by:
Hi, How do I convert a DateTime structure into the same format with the current setting on Windows? thanks, /m
2
by: WoodBeeProgrammer | last post by:
Given a server and an internet client, can the server (or client) determine the characteristics of the connection? for instance, whether it's running through a proxy, what the connection speed is,...
4
by: kanones | last post by:
I have some data that is been retrieved from a call to sql server stored procedure that I want to store for a period of time in a web farm architecture. I want to minimize the calls to sql server...
1
by: Annie | last post by:
hello all, I need to have access to some details in all my pages eg a Person object. what is the best way to do it? store in session object? or pass them through the QueryString or Application...
2
by: ge0193387 | last post by:
I have a csv file here that is output from another program. Once this csv has been completed the information needs to be extracted in multiple formats into a formatted excel spreadsheet (sheet a...
2
by: munkee | last post by:
Hi All, Basically I have been destroying my brain trying to work out how to connect to the LDAP server at work with access to search for info and import. I have a couple of questions. Firstly,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.