Hello,
I am trying to query the data set below for the data_value for the data_id of the recent data_date.
So for data_id 18554 the recent data_date will be 2/8/2016 18:40 and its data_value will be 29504.76
And for data_id 18555 the recent data_date will be 2/8/2016 18:40 and its data_value will be -90909090909 -
data_id data_name data_date data_value
-
18554 traffic_in 2/8/2016 18:30 30737.11333
-
18554 traffic_in 2/8/2016 18:10 31780.68
-
18554 traffic_in 2/8/2016 18:35 30338.82
-
18554 traffic_in 2/8/2016 18:15 31393.36667
-
18554 traffic_in 2/8/2016 18:40 29504.76
-
18554 traffic_in 2/8/2016 17:50 32225.28
-
18554 traffic_in 2/8/2016 18:00 32225.32
-
18554 traffic_in 2/8/2016 17:55 32240.71333
-
18554 traffic_in 2/8/2016 17:45 32602.98
-
18554 traffic_in 2/8/2016 18:20 30874.39333
-
18554 traffic_in 2/8/2016 18:25 30511.56
-
18554 traffic_in 2/8/2016 18:05 32090.84667
-
-
18555 traffic_in 2/8/2016 18:15 -90909090909
-
18555 traffic_in 2/8/2016 18:35 -90909090909
-
18555 traffic_in 2/8/2016 17:45 -90909090909
-
18555 traffic_in 2/8/2016 18:00 -90909090909
-
18555 traffic_in 2/8/2016 17:50 -90909090909
-
18555 traffic_in 2/8/2016 17:55 -90909090909
-
18555 traffic_in 2/8/2016 18:10 -90909090909
-
18555 traffic_in 2/8/2016 18:20 -90909090909
-
18555 traffic_in 2/8/2016 18:05 -90909090909
-
18555 traffic_in 2/8/2016 18:25 -90909090909
-
18555 traffic_in 2/8/2016 18:40 -90909090909
-
18555 traffic_in 2/8/2016 18:30 0.213333333
-
-
The results i want is -
data_id data_name data_date data_value
-
18554 traffic_in 2/8/2016 18:40 29504.76
-
18555 traffic_in 2/8/2016 18:40 -90909090909
-
But when i use the following MySQL statement -
SELECT data_id,data_name,max(data_date),data_value FROM `data_source_` where `data_id` IN (18554,18555) AND data_name = 'traffic_in'
-
this just gives me -
data_id data_name data_date data_value
-
18554 traffic_in 2/8/2016 18:40 29504.76
-
Help will be very much appreciated.
Thanks
1 1896 hsriat 1,654
Recognized Expert Top Contributor Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Mike |
last post by:
I have a mulitpage form that I do not record the information into a dbase
until the end.
I need to pass the field values form on form to the next. I have the code
for automatically
generating the 'hidden fields' but cannot figure out how to code it to
automatically generate
the assignment statements.
For example:
|
by: Raghu |
last post by:
Hello...
I am running into a problem while running a query..can some1 help..
this is the query :
**************
SELECT *
from Table S
where S.dtDate1 BETWEEN dateadd(year,1,dateadd(month,-1,getdate()))
AND dateadd(day,-1,(dateadd(month,1,dateadd(year,1,dateadd(month,-1,getdate())))))
***************
(first part of the date calculation comes out to be '2005-05-01' and
|
by: Corey |
last post by:
All,
I am relatively new to XML and I have what may sound like a dumb
question. I want to pass a query string variable to my xml document
and filter the output based on that variable. For example, if I type
in www.mysite.com?geid=0000123468 I want to display only
AccessReview/Report where GEID='0000123468'. I appreciate any help you
can provide.
Corey
|
by: jmev7 |
last post by:
I had a query with a criteria in a date field reading "> And
<", and when run, it correctly prompted first for the
param, and then for the param. I then created functions to
replace these params using an input box so that I could control the
default date in each case (based on the current day of week and other
variables). Each function works correctly, but for some reason, the
first prompt is for , and the second prompt is for ,
which...
|
by: TGEAR |
last post by:
I have an ItemSTDPriceHistory table as below and this is a child table
of itemlookup table with one to many relationship.
if exists (select * from dbo.sysobjects where id =
object_id(N'.') and OBJECTPROPERTY(id,
N'IsUserTable') = 1)
drop table .
GO
| |
by: jef3fowler |
last post by:
Drawn a blank.
Looking to find the last date each client ordered something.
The query should show each client and the last order date.
2 tables: Clients and orders. clientID in each.
Any hints/directions appreciated. Even blistering attacks on my ability.
|
by: dauwe.peter |
last post by:
A table : Nameperson, Book nr, Bookdatein, Bookdateout, CD nr,
cddatein, cddateout, dvd nr, dvddatein, dvddateout.
I would like a query where a see the personsname en de last book with
the datein and out , the last cd with datein and out , and the same
for the dvd. Because the last time the person came he toke only a
book but dit not return his dvd (for example). But with one click i
would like to see the last of every item with the...
|
by: liz0001 |
last post by:
I am trying to run an SQL query for each item in an Array using ASP.
I have coded it as such. IDsArray() is an array of integers.
ArrayLength=15
sqlGetiIDs = "SELECT * FROM Table1 WHERE (dID = " & IDsArray(j) & ")"
j=0
Dim GetiIDsRSArray(ArrayLength)
|
by: phill86 |
last post by:
Hi
I am re-posting this thread because it has become very confusing and I have got some way to solving the problem so it is a slightly different question from the initial thread.
here is the original tread
http://bytes.com/topic/access/answers/872005-query-date-range
Just to clarify what I am trying to achieve....
|
by: jase7678 |
last post by:
I have a database containing an ItemTypesColors table which has a 1:Many relationship with an ItemDescription table which has a 1:Many relationship with an ItemVendor table.
The ItemTypesColors table comprises Item Type & Color, eg: Shirts|White, Shirts|Black, Jeans|Blue etc.
The ItemDescription table contains the number of items in a package, a link to the ItemVendor table, price etc.
The ItemVendor table contains the Vendor name, a...
|
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...
| |
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,...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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...
|
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...
|
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();...
| |
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
|
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...
| |