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 8120331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T05:07:43+00:00 2026-06-06T05:07:43+00:00

I have an aspx document that returns a list of incoming flights from a

  • 0

I have an aspx document that returns a list of incoming flights from a database in the form of an HTML table. It displays all flights from the current day. The part that generates the rows is:

    string fechha = dias + "/" + mess + "/" + años;
    string fecVuel = fechha;

    for (int i = 0; i <= num - 1; i++)
    {
        string hora = xl.ChildNodes[0].ChildNodes[i].ChildNodes[5].InnerText;
        fecVuel = xl.ChildNodes[0].ChildNodes[i].ChildNodes[0].InnerText;
        if (fecVuel == fechha)
        {
            fila = new TableRow();

What I would like is to have it only get flights that match an specific time period, like 2 hours before and after the current time. In the code, the value of string hora is the time of flight retrieved from the db.

I tried adding a current time variable with rightnow = DateTime.Now.Hour; and adding a conditional, like this:

if (fecVuel == fecha && ((hora >= rightnow - 2) || (hora <= rightnow + 2))) {...

But it’s still generating the entire table. I even tried changing it to fecVuel != fecha but it changes nothing :S I’m not too good with asp, and I’m using Notepad++ for edits. Any ideas? Thanks for your time.

  • 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-06T05:07:46+00:00Added an answer on June 6, 2026 at 5:07 am

    Let’s say right now, it’s 14:00

    Two hours ago it was 12:00. In two hours it will be 16:00.

    Right now (14:00) will always satisfy one of the two conditions:

    Greater than 12:00 OR less than 16:00.

    If you change the OR to AND, both conditions must be satisfied.

    if (fecVuel == fecha && ((hora >= rightnow - 2) && (hora <= rightnow + 2)))
    

    Only times between 14:00 and 16:00 (not inclusive those times) are selected if you use AND.

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

Sidebar

Related Questions

I have an aspx web form in a WCF service project that gives a
I have a form that I want to validate looks like this: <!DOCTYPE html
I have a URL like below : http://localhost:1692/fa/Help.aspx#Help the code below returns that :
I have an aspx page that returns valid JSON - however when called via
I have a aspx page that has a UpdatePanel and a asp timer. the
I have a .aspx page that loads three separate .ascx controls to represent adding,
I am performing a jQuery .ajax() call that returns a List<string> of IP addresses
I have a set of nested unordered lists that represents page navigation. The list
We have to read data from a aspx page. When we call the page
I have made a custom textbox that inherits from textbox. using System.Drawing; using System;

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.