[Solved] Query with Data Parameter

Creating tables and queries
Post Reply
leo1
Posts: 85
Joined: Mon Jan 07, 2008 5:11 pm

[Solved] Query with Data Parameter

Post by leo1 »

This is similar to another question.

I have a table with dated notes is it possible to have a quesry that I can enter two dates to only show the notes between the two dates entered? If so what would the formula look like?

For example I want to display the notes from 01/01/08 to 03/01/08.

Thank You
Last edited by leo1 on Fri Apr 04, 2008 3:16 am, edited 2 times in total.
User avatar
Sliderule
Volunteer
Posts: 1279
Joined: Thu Nov 29, 2007 9:46 am

Re: Query with Data Parameter

Post by Sliderule »

leo1:

You asked:
leo1 wrote:I have a table with dated notes is it possible to have a quesry that I can enter two dates to only show the notes between the two dates entered? If so what would the formula look like?

For example I want to display the notes from 01/01/08 to 03/01/08.
The answer is, yes. See the link below with a 'graphic' showing how to accomplish this task.

http://www.oooforum.org/forum/viewtopic.phtml?t=60975

I hope this helps, please be sure to let me / us know.

Sliderule

Thanks to add [Solved] in your first post title (edit button) if your issue has been fixed / resolved.
leo1
Posts: 85
Joined: Mon Jan 07, 2008 5:11 pm

Re: Query with Data Parameter

Post by leo1 »

I tried it but it doesn't work no fields show up, but I know there are dated notes within the entered parameters.

One thing mught be is that I don't have two date fields I only have one, but I added a field to the table so I would have two date fields.

Is there a way to search a date range with only one date field in the table?

this is what I put in:

Image
By lsearcey at 2008-04-02
User avatar
Sliderule
Volunteer
Posts: 1279
Joined: Thu Nov 29, 2007 9:46 am

Re: Query with Data Parameter

Post by Sliderule »

leo1:

I think you have a MINOR correction to make . . . you should NOT add a new date field to the table.

In your case . . . the field Date from your table Biznotes has a :From_Date . . . that is good.

Now . . . also . . .
  1. Double click on Date from your table Biznotes again ( a second time )
  2. On the Criterion line . . . enter :To_Date
  3. On the Visible line . . . uncheck the box for the added Date
The idea is . . . to ADD an additional condition to the Query ( not a new table field ) . . . that is . . . a date range ( between certain dates ) . . . BUT . . . you only need to display the date once in the result list.

I hope this helps, please be sure to let me / us know.

Sliderule

Thanks to add [Solved] in your first post title (edit button) if your issue has been fixed / resolved.
leo1
Posts: 85
Joined: Mon Jan 07, 2008 5:11 pm

Re: Query with Data Parameter

Post by leo1 »

I'm sorry have to ask this, but do I put both the :From_Date and :To_date on the criterion line?
User avatar
Sliderule
Volunteer
Posts: 1279
Joined: Thu Nov 29, 2007 9:46 am

Re: Query with Data Parameter

Post by Sliderule »

leo1:
leo1 wrote:I'm sorry have to ask this, but do I put both the :From_Date and :To_date on the criterion line?
Yes, just like in the the image in the post I gave you above.

Your graphic is correct, with ONE exception . . . change the Field Test Date to Date from your table Biznotes.

Please be sure to let me / us know if this helps.

Sliderule

Thanks to add [Solved] in your first post title (edit button) if your issue has been fixed / resolved.
leo1
Posts: 85
Joined: Mon Jan 07, 2008 5:11 pm

Re: Query with Data Parameter

Post by leo1 »

It works thank you for your help! :D
Post Reply