473,770 Members | 3,912 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

parameter query data format problem

This is probably very simple, but I just can't see my way thru it.....

Short version: keyed values(numeric) in a lookup table are stored in a
main table. They are displayed as text values - the keyed values
description. I need a parameter query to return a range of these
values. The parameter input won't accept the 'text' version. You can
do it with 'Find' because you can select 'as formatted'. But I need a
range. Please, any guidance would be appreciated.

Long Version:
Background:
I have 2 LU tables used to input Cold Hardiness zones for
plants in a table of Plant species. The values are
similar to 9, 9A, 9B, 10, 10A, etc. One needs to select
plants by Zone - qry to return plants with a hardiness
Zone > 9A AND < 10B, for example. [BTW - info only: for
clarification- there are 2 Hardiness Zone fields
in the Plants TBL - one for the plants most northern range, one for
the southern range. So a query of >9b in one field and
<10B in the other field will return the needed results -
except for the data format problem. See below.]

Even though the values are alpha numeric, in order to sort
properly (9A is colder than 10B), they must be numeric in
the underlying data. But they must appear alpha-numeric.
The user would never see (or understand) the vaule of 9A =
9.25, of 10B = 10.75 for example.

Structure:
The Zone fields in the Plant TBL is a 'single' number. It's
type is a Lookup Wizard, which is a keyed table of 2
columns as follows:
Zone LU Table
PrimaryKey
ZoneValue Zone Description
(number-single) (text)
9.0 9
9.25 9A
9.75 9B
10.25 10A
etc. etc.

Plants Table
Primary Key ZoneNorth ZoneSouth
PlantID ZoneLU Combobx [same]
(auto-increment) stored as number [same]
displayed as Text [same]
5 stored: 9.0
displayed: 9
6 stored: 9.25
displayed:9A
Only Column 'ZDescpt' shows. So you, in effect, type or
select a Text value which displays as a text value, but is
recorded as a number value. Life is good. The table will
sort just fine.

Problem:
If you do a 'Find' on the field, you have the option to
select 'as formatted' and if you type into the Find box:
9B if will return all 9Bs. Again, life is good. It accepts
the text value, and returns the appropriate number values
displayed as text.

However what I need is for it to return a range, there
fore I need a parameter query. The problem is that you
can't enter >=9B for example because the underlying values
are numeric. You get that lovely message saying too
complex, etc.

I know there is a way to do this, I just can't fathom what
it might be. If the 'Find' feature allows it, it must be
possible thru some other route. I can write simple code
fairly well if needed, I just can't seem to think through this.

Once I fathom how to do this, I'll probably have it display in a
datasheet form and/or a report.

I'd sure appreciate any guidance, thoughts or ideas.

Thanks,
Anne
Nov 12 '05 #1
2 2686
DFS
Try using the DLookup function:
SELECT *
FROM Table
WHERE ZoneValue >= DLookup("ZoneVa lue","ZoneLUTab le","ZoneDescri ption = '" &
Forms.FormName. FindBox & "'")

"Betrock" <Be*****@yahoo. com> wrote in message
news:7a******** *************** ***@posting.goo gle.com...
This is probably very simple, but I just can't see my way thru it.....

Short version: keyed values(numeric) in a lookup table are stored in a
main table. They are displayed as text values - the keyed values
description. I need a parameter query to return a range of these
values. The parameter input won't accept the 'text' version. You can
do it with 'Find' because you can select 'as formatted'. But I need a
range. Please, any guidance would be appreciated.

Long Version:
Background:
I have 2 LU tables used to input Cold Hardiness zones for
plants in a table of Plant species. The values are
similar to 9, 9A, 9B, 10, 10A, etc. One needs to select
plants by Zone - qry to return plants with a hardiness
Zone > 9A AND < 10B, for example. [BTW - info only: for
clarification- there are 2 Hardiness Zone fields
in the Plants TBL - one for the plants most northern range, one for
the southern range. So a query of >9b in one field and
<10B in the other field will return the needed results -
except for the data format problem. See below.]

Even though the values are alpha numeric, in order to sort
properly (9A is colder than 10B), they must be numeric in
the underlying data. But they must appear alpha-numeric.
The user would never see (or understand) the vaule of 9A =
9.25, of 10B = 10.75 for example.

Structure:
The Zone fields in the Plant TBL is a 'single' number. It's
type is a Lookup Wizard, which is a keyed table of 2
columns as follows:
Zone LU Table
PrimaryKey
ZoneValue Zone Description
(number-single) (text)
9.0 9
9.25 9A
9.75 9B
10.25 10A
etc. etc.

Plants Table
Primary Key ZoneNorth ZoneSouth
PlantID ZoneLU Combobx [same]
(auto-increment) stored as number [same]
displayed as Text [same]
5 stored: 9.0
displayed: 9
6 stored: 9.25
displayed:9A
Only Column 'ZDescpt' shows. So you, in effect, type or
select a Text value which displays as a text value, but is
recorded as a number value. Life is good. The table will
sort just fine.

Problem:
If you do a 'Find' on the field, you have the option to
select 'as formatted' and if you type into the Find box:
9B if will return all 9Bs. Again, life is good. It accepts
the text value, and returns the appropriate number values
displayed as text.

However what I need is for it to return a range, there
fore I need a parameter query. The problem is that you
can't enter >=9B for example because the underlying values
are numeric. You get that lovely message saying too
complex, etc.

I know there is a way to do this, I just can't fathom what
it might be. If the 'Find' feature allows it, it must be
possible thru some other route. I can write simple code
fairly well if needed, I just can't seem to think through this.

Once I fathom how to do this, I'll probably have it display in a
datasheet form and/or a report.

I'd sure appreciate any guidance, thoughts or ideas.

Thanks,
Anne

Nov 12 '05 #2
Thanks, I'll try it. Completely forgot about DLookup. Too many
things swirling around in very limited brain! Thanks again, Anne
"DFS" <no****@nospam. com> wrote in message news:<10******* ******@corp.sup ernews.com>...
Try using the DLookup function:
SELECT *
FROM Table
WHERE ZoneValue >= DLookup("ZoneVa lue","ZoneLUTab le","ZoneDescri ption = '" &
Forms.FormName. FindBox & "'")

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
21710
by: Lyn Duong | last post by:
Hi I am trying to retrieve data from a db2 v8.1 fp2 database via msquery and I use the add-criteria function to allow users to input a data parameter. The value is inputted as YYYY-MM-DD but when I run this, the following error occurs CLI0113E SQLSTATE 22007: An invalid datetime format was detected; that is, an invalid string representation or value was
2
6516
by: Julie Wardlow | last post by:
Help! I am calculating a future date using the DateAdd function in a query (the calculation also involves an IIf statement), and have managed to get this formula to produce the required result. I then want to search through the records and select those with dates (as caluclated above) within a user defined range, and so I am using a parameter query. However, this query returns dates outside of the range and appears to have particular...
10
5606
by: Dion Heskett | last post by:
I wish to supply the formating as a parameter, I have tried OleDbDataReader but get a null ref. just can't seem to get this to work. I think this has something to do with ExecuteReader. also can't seem to use this as the first pram OleDbDataReader reader = new OleDbDataReader() i.e public static string Read(OleDbDataReader reader, string query, string
6
4480
by: tizmagik | last post by:
I am having a lot of difficulty generating a CrossTab Query based report. I have looked online for several tutorials and whatnot but I have not been able to really find what I'm looking for, nor have I been able to adapt other people's solutions/tips to fit what I need. If anyone could please help me with the following it would be really appreciated, thank you! I need to generate a Report (say: repCrossTab) that grabs it's data from the...
2
3134
by: BillCo | last post by:
A2000, DAO 3.6 ref set, 2 Parameters in query from an unbound form. Dim db As DAO.Database Dim rst As DAO.Recordset Dim qryDef As DAO.QueryDef Dim prm As DAO.Parameter Set db = CurrentDb Set qryDef = db.QueryDefs("qryWeeklyCreditClass")
3
7701
by: Darin | last post by:
I have a problem I just can't figure out. I have a form with a subform, and the recordsource of the subform has criteria based on some unbound fields in the parent form so that data in the parent form affects data in the subform. I've had this type of setup often, but I've run across a couple forms where this has caused an "enter parameter value" pop up for each reference to the parent control in the query when the main form is closed. ...
4
1605
by: pechar | last post by:
Hi all, I'm having a hard time creating a query with parameters. I have a table which contains ID numbers (not primary key) which are just a value attached to a customer. In a way like a password without which the user cannot continue to checkout on a site we're developing. The problem is that we don't specify the exact format of this data and so need to make a check for a certain amount of zeros before the actual number. i.e. the values...
5
5307
by: Trevisc | last post by:
Happy Thursday Everyone, I am trying to create a parameter that is one long varchar but that will be used in a SQL statement IN function: //string queryString = GetCurrentTitles(); //Below is for Test string queryString = "45322,32222,33344,55555"; dataset catalogDS = new dataset();
8
4637
by: DanicaDear | last post by:
I have something interesting...looking to see if anyone else has came across this. I have a query with parameter and and the query works beautifully every time. However, when I use the wizard to build a report, at the end of the wizard the report opens beautifully, asks for the 2 parameters, and displays results. Beautiful. Then, after closing the report and re-opening, the report promts me for a third, unwanted parameter. ...
0
9602
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9439
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10071
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9882
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7431
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6690
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3987
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3589
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2832
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.