Can anybody help ??

racdata

Registered User.
Local time
Today, 07:28
Joined
Oct 30, 2002
Messages
74
Hi all

:confused: :confused:
I have a table (In Oracle) where we store all our assets - almost 35000 of them.
In the table there are fields named KM_From and KM_To
These fields are Text fields on the table,

Now what I tried to do is the following
I want to set up a query where I query field (KM_From) a KM point then query field KM_To and get all the assets registered in that length of railtrack.


Query - Give all assets from Km 2.856 to 8.654
Display - AX/xxx999 KM 2.865 - 3.548
AX/xxx888 KM 3.548 - 4.558 etc.
 
rac,

Maybe?

Code:
Select AssetName, KM_From, KM_To
From   AssetTable
Where  (CDbl(KM_From) >= 2.856 And
        CDbl(KM_From) <= 8.654) Or
       (CDbl(KM_To) >= 2.856 And
        CDbl(KM_To) <= 8.654)
Order by CDbl(KM_From)

Wayne
 
Can you figure it out

I include a zip file with part of the actual data from the database

If you can figure it out I will appreciate it.


A message box will pop up - KM From - (The user then enter 2.856)
Then a second message box pop up - KM To (The user then enter 8.654)

All I want is a query with assets between 2 Km points
The table is the exact data from Oracle, I only delete most of the records.
 

Attachments

Wayne


It seems to me nobody have the answer


Some of the Asset_Aux_Val* fiels are renamed
We are using Asset_Aux_Val2 and Asset_Aux_Val3 to enter the KM from and Km To in. These are Text fields and I do not know if I can get what I want
 

Attachments

Last edited:
OK, your problem includes format conversion, but I cannot download your files. (My site security is in the way of that.)

The question is the format of what you are querying vs. the question you are asking.

If you put .... "WHERE KM_From > 8.456 "

then KM_From MUST be SINGLE or DOUBLE in format. Or possibly Currency, but that would be a kludge. The only formats that align comparisons on explicit decimal points are SINGLE or DOUBLE data types - or Currency, but that would be cheating to use it that way.

If KM_From is in text format, you must either convert the input criteria to text (which I don't recommend) or convert the field to numeric format.

That might not be enough to solve your problem, but I'm not sure about the meaning of what you have in the DB so I can't guess how to use it.
 

Users who are viewing this thread

Back
Top Bottom