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

  • Home
  • SEARCH
  • 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 6349553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:38:22+00:00 2026-05-24T21:38:22+00:00

I’ve done something like this in pvp using while loop but I don’t think

  • 0

I’ve done something like this in pvp using while loop but I don’t think that is valid for vb. I have a total of 4 tables and 3 of them are based off of 1.

Main Table:
weather

Sub Tables:
applicationData
accidentData
trafficData

My goal is to use my filter system to check the weather data table. It then searches the other tables for traffic, accident, and application data based off the location, date, and time of the weather data fields. (They all share these columns). There are times where there are several accidents for each date/time/location.

For the sake of being easier to explain I’d like you to explain it with two different tables so here are my queries.

SELECT event, date, time, location 
FROM weather 
WHERE date= '" & datepicker.Text & "' 
AND time = '" & eventTime.SelectedItem.Value & "'

I then want to take the date, time, and location and search one of the sub tables with that information.

SELECT roadway_number, mile_marker 
FROM  accident 
WHERE date= 'query1Date' 
AND time = 'query1Time' 
AND location = 'query1Location'

I think want to display all this information in a datagrid and have it display to show all weather fields even if there is no accident data to go with it. Like this:

1pm, 12/1/10, Amity
Weather Event: Snow

2pm, 12/1/10, Amity
Weather Event: Light Rain

5pm, 12/1/10 Amity
Weather Event: Heavy Snow
Accident:
Road: I165N, Mile_Marker 95.5
Road: I165N, Mile_Marker 71

7pm, 12/1/10 Amity
Weather Event: Heavy Snow
Accident:
Road: I165S, Mile_Marker 85.5

I really appreciate the help!

  • 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-05-24T21:38:24+00:00Added an answer on May 24, 2026 at 9:38 pm

    Instead of querying the database in a loop (a real performance killer), join the tables in your query:

    SELECT weather.event, weather.date, weather.time, location,
        accident.roadway_number, accident.mile_marker
    FROM weather
    LEFT OUTER JOIN accident on weather.date = accident.date and weather.time = accident.time
        and weather.location = accident.location
    WHERE date= '" & datepicker.Text & "' AND time = '" & eventTime.SelectedItem.Value & "'
    

    The OUTER join is the key to getting all weather records regardless of if there are related accidents.

    You should also look into parametrizing your query instead of concatenating the input values.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have some data like this: 1 2 3 4 5 9 2 6
this is what i have right now Drawing an RSS feed into the php,
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I am trying to loop through a bunch of documents I have to put
I have a JSP page retrieving data and when single or double quotes are
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string

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.