Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8961955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:00:54+00:00 2026-06-15T16:00:54+00:00

I am trying to get logging data from a table. Where I select a

  • 0

I am trying to get logging data from a table. Where I select a timespan (“maandag” till “vrijdag”). This gets the results I want but now I get the question to only show 3 measurements per day.

The first one being the first after 8 o clock
The second one being the first one after 14:00 o closk
and the third the first one after 20:00 o clock

The problem I have is that the time of the measurements is not constant. So using a regexp to select a part of the day doesn’t work.
With the query below I sometimes also get 2 or 4 or even more results per day. This is because basicly the time between measurements is 2 hours but this is not constant neither is it so that measurements the next day are on the same time.

Is it possible to group by a part of the day?
Or what other solution is there?

data:
id datumTijd ph tbc temperatuur vbc gbc
1 2012-10-03 14:59:19 7.30.08 24.91 0.02 0     
1 2012-10-03 16:47:38 7.33.07 22.15 0.12 0
3 2012-10-03 17:03:06 7.31.09 23.23 0.05 0


query:
SELECT N.name, D.datumTijd, ROUND(D.gbc,2), ROUND(D.vbc,2), ROUND(D.tbc,2),ROUND(D.ph,2), ROUND(D.temperatuur,1)  
FROM METING.Name N, METING.Data D 
Where D.datumTijd BETWEEN "'+maandag+' 00:00:00" AND "'+vrijdag+' 23:59:59"  
AND N.id = D.id AND D.datumTijd 
AND D.datumTijd REGEXP "0[78]:..:..|1[34]:..:..|2[12]:..:.."';
ORDER BY N.name, D.datumTijd 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T16:00:55+00:00Added an answer on June 15, 2026 at 4:00 pm

    You could do something like this to group results into the 3 different periods. You could then use aggregate functions (SUM, MIN, MAX) on your measures.

    SELECT   DATE(D.datumTijd),
             CASE WHEN TIME(D.datumTijd) BETWEEN '08:00:00' AND '14:00:00' THEN 1
                  WHEN TIME(D.datumTijd) BETWEEN '14:00:00' AND '20:00:00' THEN 2
                  WHEN TIME(D.datumTijd) BETWEEN '20:00:00' AND '24:00:00' THEN 3
             END as period
    ...
    GROUP BY DATE(D.datumTijd),
             CASE WHEN TIME(D.datumTijd) BETWEEN '08:00:00' AND '14:00:00' THEN 1
                  WHEN TIME(D.datumTijd) BETWEEN '14:00:00' AND '20:00:00' THEN 2
                  WHEN TIME(D.datumTijd) BETWEEN '20:00:00' AND '24:00:00' THEN 3
             END
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been trying to Base64 encode image data from the user (in this case
I am trying to get some data from the user and send it to
I'm logging onto a website, trying to get the cookies running. From what I
Trying to archive some data from one database table to another over linked server
This is basically javascript problem I am trying to get data by Ajax and
I'm trying to get an html table from a dynamic php page on my
I am trying to get logging via the application.ini file going and I am
I'm trying to get logging enabled on my application using Fluent NHibernate and log4net.
I am trying to get a logging project up and running and having difficulties
I'm trying get the visible portion of UIImage from an UIImageView . UIImageView takes

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.