Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 14th, 2005, 03:40 AM
Registered User
 
Join Date: Mar 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Critical Query

Hi All,
Please Solve this problem,
Let me give you the problem -- I have two tables one called Main and the other is called Donations and there are two fields in Donations table one is date and another is notes.ID is a field in Main table which is a primary key in Main and foreign key in Donations.
 What we have to do is that -- we have to arrange and display the Main table records in such a manner so that the Ids who have a "Desired Match" against their notes field in the Donations table and minimum date in the date field comes first on ascending order of date arrangement.
Thats all
Can you sort it out without using any (min),(Distinct) etc key word.

ps_kaushik
 
Old March 15th, 2005, 12:54 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Hi,

   Here is how I would do this assuming this is the proper table structure:

tblMain
notes.ID - PK (bad name since PK should be table name + ID, Pascal cased, no periods.
...

tblDonations
DonationsID - PK
Date - (bad name for this field as its a reserved name)
notes.ID - FK tblMain


   Open the query builder in design view.

   Add tblMain and tblDonation to the design window.

   Select the requisite fields from each table that you want.

   Sort the Date Ascending

   If you want to get some criteria from the user during the query runtime, then enter this on the criteria line:
   Like "*" & [Enter Desired Match data:] & "*"
   This will allow you to look for a match in the middle of the string. If it will always be at the beginning or end, then remove the other asterisk accordingly.


   If you want to pass the Desired Match data from a combo box on a form, then I can show you how to do that.

HTH




mmcdonal





Similar Threads
Thread Thread Starter Forum Replies Last Post
Javascript Critical Section ? tal Javascript How-To 1 April 11th, 2008 04:39 PM
critical problem s_a_ravi Classic ASP Basics 1 August 28th, 2005 06:13 PM
Critical Problem in accessing ODBC From XP bveerendrakumar Pro VB Databases 2 June 12th, 2004 12:12 AM
Syntax error in query. Incomplete query clause. dispickle ADO.NET 3 April 16th, 2004 01:04 PM
Critical problem in Biztalk server Bala chandra Sekhar Biztalk 1 November 12th, 2003 05:30 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.