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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:51:22+00:00 2026-06-17T13:51:22+00:00

I am writing a web2py query to run against the database but it won’t

  • 0

I am writing a web2py query to run against the database but it won’t display the results as i get an error stating Set: No tables selected…

I was wondering if some one can help me out with this?

The table I was to run the query against is:

db.define_table('Flight',
    Field('FlightNum', type = 'string', length = 10, notnull = True),
    Field('PlaneID', type = 'string', length = 10, notnull = True),
    Field('DepartureLocation', type = 'string', length = 20, notnull = True),
    Field('ArrivalLocation', type = 'string', length = 20, notnull = True),
    Field('DepartureDate', type='date'),
    Field('ArrivalDate', type='date'),
    Field('DepartureTime', type = 'time'),
    Field('ArrivalTime', type = 'time'))

My query is:

def displayFlights():
    tuples=db((db.Flight.DepartureLocation is request.vars.DepartureLocation)&
       (db.Flight.ArrivalLocation is request.vars.ArrivalLocation)&
       (db.Flight.DepartureDate is request.vars.DepartureDate)&
       (db.Flight.ArrivalDate is request.vars.DepartureDate)).select()
    return dict(tuples=tuples)

Can some one please help me correct this query?

  • 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-17T13:51:24+00:00Added an answer on June 17, 2026 at 1:51 pm

    Queries must be constructed with ==, not is:

    db.Flight.DepartureLocation == request.vars.DepartureLocation
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Writing a python program, and I came up with this error while using the
I am writing a web2py application that requires summing dollar amounts without losing precision.
Writing a simple program that will find exact duplicate files on my computer, but
writing to a text file is working good...But my problem is text file is
Writing a bash script, and I want to get user input. Awesome, read -p
Writing some XML documentation for a predicate helper class. But I can't figure out
Writing html using Response.Write in asp.net it doesn't display the image. I check my
Writing a dictionary application for android. Want to set translation direction in accord with
writing somewhat of a css hack, styling for :hover {} works interestingly, but browsers
Writing some docs with code snippets which I want to be copyable to run

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.