Query Criteria 05-24-07

Finding it hard to get my head round this so help needed!

I have a query based on form fields. There is date range field (always
selected) and 2 other optional criteria needing 4 WHERE/OR statements
to get the required results.

I want to add another optional criteria field which i think will leave
me with 11 WHERE/OR statements and a big headache!

Is there a simple way around this?

0
andy
5/24/2007 11:34:09 AM
access 16762 articles. 3 followers. Follow

0 Replies
638 Views

Similar Articles

[PageSpeed] 33

Reply:

Similar Artilces:

problem with append query
Hello experts, I have a form witha subform, I need to append the records from the subform into a table. I set it up and it seems to be fine but there is a problem. Only one record from the subform is appended into the table and it is always the record that is selected. is there any way to send all the records that are showing in the subform window to the table? Thanks again in advance Isn't this the same question I just replied to in the Reports NG? Please ask your question in a single NG. -- Duane Hookom Microsoft Access MVP If I have helped you, please help me by donating to UC...

Query Flaw???
I need only one value from an aggregate Query - TheStores, which means the Number of Inspections in a "From - To" Timeframe. I use that as part of a calculation. The "Inspections" table contains only a Store and an InspectionDate. It gives me the result I need...but no Join...the Query has several other Fields from "Randy_F_FindFreq", but has been trimmed as an example here. SELECT Randy_F_FindFreq.AAll, Randy_Insp.TheStores, Round([AAll]/[TheStores],4) AS PerAll FROM Randy_F_FindFreq, Randy_Insp; Is this "sound"? TIA - Bob Without a join yo...

Auto Numbering 09-13-05
I would like to create an auto number field to be used as a customer number. I would have thought this would be a common requirement. Is this possible. thanks in advance Todd this is a common issue and the way to achieve it is to use post callout code which finds the last number used and then calls back into the crm application layer to update the record. here is some example code for crm 1.2 http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnmbscrm1_2/html/mbs_crmpostcalloutsv1d2.asp "Tango" <Tango@discussions.microsoft.com> wrote in message news:89FA...

Integration Manager
I am experiencing a problem selecting rows from a Microsoft SQL Server table (ODBC) when utilizing a parameter. Does anyone have any working samples? I'm no expert. I used scripts and here is what is in the before script. I pass the ACT_PTD to my stored procedure ------------------------------------------ Dim luserid dim lintercompanyid dim oMsgrObj Set userinfo = CreateObject ("RetrieveGlobals.retrieveuserinfo") luserid = userinfo.retrieve_user() lintercompanyid = userinfo.intercompany_id() Set userinfo= nothing msgbox ("The company you are currently logged into is &q...

Difference 05-21-04
What is the difference between CRM standard and professional? -Johnny Johnny wrote: > What is the difference between CRM standard and professional? > > -Johnny Does it have anything to do with Outlook integration? -- - I am Johnny! Your Internet penpal. I have a scooter, how about you? "Johnny" <alphascooter-verizon@yahoo.com> wrote in message news:evfBJNwPEHA.3708@TK2MSFTNGP10.phx.gbl... > Johnny wrote: > > > What is the difference between CRM standard and professional? > > > > -Johnny > Does it have anything to do with Outlook inte...

Access 2003 qry criteria filters
Does anyone have an idea as to why a database would suddenly change how it is filtering a qry? I haven't made any changes to the qry I have created but now it is showing data that I don't want. The filter looks something like this: Order Qty Ship Curr Line Code <------ these are just the headers >0 <Date()+56 Like "Y31*" or Like "X31*" >0 <Date()+56 Not Like "Isnull" When I run the qry I am getting line codes that start with Z and F and as you ...

Report Server Error 09-28-07
After uninstalling MSCRM from my server, I tried installing it again. This has led me to the problem of the report server. I'm using the default server name http://<servername>/reportserver and it's still not realizing that it is actually there and fully running. I've checked the Services section of my server and also checked the individual server status. Both are running within normal parameters. Before the uninstall, the report server was running properly and CRM recognised that it was actually there. Any ideas? ....reed Is this SQL Server 2000 or 2005 SRS? 1. Fo...

access forms 12-05-07
how can the minimum value from eight numeric fields be found & displayed displayed on the form, following manual entry? Your only way is through a series of If statements to determine the minimum. Remember, too, that you may need to handle missing data. You can use the Nz function in that case, but you need to be able to assign a reasonable value for comparison purposes if the value is Null. Dim lngMinimum As Long lngMinimum = Nz(Me.Field1, 9999) If Nz(Me.Field2, 9999) < lngMinimum Then lngMinimum = Me.Field2 End If If Nz(Me.Field3, 9999) < lngMinimum Then lngM...

Reading empty query returns
When I open a form that has a bound query as the record source, no data appears (including the control objects of the form) if the query's select statement does not finds records that match the criteria I specify. This causes a problem in my VBA code as the variable I use to check the number of records returned by the query does not seem to be able to read empty query returns, even if I use isnull. So I guess I am asking how can I get Access to read an empty result set in VBA from a SQL select statement that is run??? Here is part of my code for this: DoCmd.OpenForm stDocName2, , ...

Importing a table from Access query
What is the quickest and easiest way to do the above? Thanks in advance. Hi The way I usually do this is run the select query, click on the top-right box (which selects all records) and use Ctrl+C to copy and Ctrl+V to paste into my workbook. An alternative is to right-click on the query in the Database Window and left-click on Export. In the Save As dialog box, select ..xls type. -- Andy. "Trish" <Trish@discussions.microsoft.com> wrote in message news:6BF3DE22-6590-4CAD-9EE1-FC978A3BB63B@microsoft.com... > What is the quickest and easiest way to do the above? >...

Select query problems Access 2003
Good morning everybody I'm using Access2003 on Windows XP SR2 I want to run a select query using parameters to query a table of placenames and details. All pretty straightforward. When I try a click event using the selection of a combo or listbox to set the criteria in the query { Forms![frmSearch]![cboName] } the query gives a nil return nothing happens....the form opens but doesn't display any results. But when is use a txtBox and manually enter known data and run a command button everything works as it should This is the code for the cmd button. Private Sub cmdS...

IIF statement 08-23-07
I would like to use an IIF statement to look for the text in field [Type] and if it is not Voluntary, to show Employer on the report. I have tried IIF([Type] Not Like "Voluntary","Employer","Voluntary") and all I get is Employer listed on the report. It changes those that are voluntary to employer. Not sure what I am doing incorrectly. Karen Check Access HELP on "Like". Your IIF() expression tells Access to look for EXACTLY "Voluntary" in the [Type] field. If you meant "Voluntary" SOMEWHERE IN the [Type] field, you'd ne...

Missing records using a timestamped field to query.
I'm trying to extract a range of information using a timestamp field through a select query. I'm using Between[Date] and [Date]. It's not caputuring all of the records, specifically the records w/ the 1st and the very last days of the range. I tried doing something like this "Date([Timestamp])" but to no avail. Any thoughts as to why?! Thanks, Michael On Tue, 12 Feb 2008 08:39:02 -0800, Michaelcip <Michaelcip@discussions.microsoft.com> wrote: >I'm trying to extract a range of information using a timestamp field through >a select query. I'm...

Event Log Queries
Ok, so I'm working on querying multiple DC's to look for a specific event ID (645 in the security logs, for computers recently joined to the domain). I thought I had everything figured out, but it's still not working right. Running the script, it just somewhat hangs...not sure if that's just because it's still searching or not and is slow. Let me know if you guys have any thoughts...thanks! Dim objDictionary Set objDictionary = CreateObject("Scripting.Dictionary") arrComputers = Array("DC02", "DC03") iReach = 0 For Each st...

displaying Query results to subform
First--the disclaimer--I am in no way a programmer, but I am working diligently to support my team in any way possible. With that said, I have painstakingly created a simple build SQL string code in Access Visual Basic Editor: Private Sub Command8_Click() Dim SQL As String SQL = "SELECT * " & _ "FROM [BCSG_CARDFILE] " & _ "WHERE ((([BCSG_CARDFILE].[IMPORT_FILENAME]) Between " & _ """" & _ Forms![BCSG_CARDFILE_SEARCH]!cboDateFrom.Value & _ """" & _ " And &quo...

Query to Filter by Dates, Using Form
I’m kind of stuck on a query! This works fine, when I just filter for Customers and Traders. Then, I went ahead and added in a couple of ComboBoxes, to allow me to choose a From-Date and a To-Date…now my dynamic query doesn’t work anymore… This SQL Works fine for Cust and Trader, but not for dates: SELECT * FROM Trades WHERE Trades.[Cust] IN('') AND Trades.[Trader] IN(''); Below is my SQL for filtering by dates, but it DOES NOT WORK: SELECT * FROM Trades WHERE ((Trades.Tdate) Between [forms]![SearchForm]![cboFrom] And [forms]![SearchForm]![cboTo]) AND Trad...

Query wildcard symbols
Just a heads-up in case this bites you, too. I migrated an application from Access 2002 to Access 2007. I have a search form for the users to enter some criteria ... the form dynamically builds a SQL WHERE clause before opening a "results" form based on an underlying query that includes all the fields available to search on. Once in Access 2007 format, the search form opens empty every time?! When I add selection criteria to the underlying query directly, the result set is empty every time?! Oh wait, I'm using the "*" (anything/everything) wildcard character. W...

Xtab query question.
I am trying to put a criteria into a xtab query via the Combo on a form. I use the builder to get "Forms![FrmPopupCustProd]![Combo]0" and this is inserted into the criteria field of the xtab query. But the query opens to give no results at all. Is this the wrong treatment for a crosstab query? Please help, Frank A few suggestions, Frank: 1. Is the zero at the end really part of the parameter? (Perhaps it should read Combo0 inside the square brackets?) 2. Make sure the field you apply this criteria under reads Where in the Total row. If you need to show the output of t...

Excel 07
Hi, I am having trouble accessing a particular XLSM spreadsheet via OleDB from vb.Net and FW 2.5. As the spreadsheet was given to me, I was unable to access the desired sheets. I was sanitizing the spreadsheet to send to someone and I went to run document inspector to see if I needed to clean any other information out. First, the inspector told me that it could not run because I had protected worksheets. So I unprotected the protected worksheets and re-ran the inspector. It told me that that I had 1 hidden worksheet. So I let it remove that. Anyway, once I had pe...

Help-Updating from a Web File Download to a Direct Download in '05
I am using Money 2005 and my financial institution just went from web downloads of files to Direct downloads where I can enter my id and password in Money. Is there a way to disable my existing account and have the direct download take over that does not require me to have the new direct download be a new account and then use the Merge feature? I was hoping I could disconnect and reconnect. Has this process changed for 2006 or 2007? Thank you -- Matt ...

Record Count 10-02-07
Experts, I'm trying to dynamically stored the record count from a subform into a field on my form. Now I have to look at the record count on the subform and manually entered the count into a field on form. There must be a better way. Please help! In the Control Source property of a text box on the main form: =[SubFormControlName].[Form].[recordset].[RecordCount] Where SubFormControlName is the name of the subform control, Not the name of the form that is the Source Object of the subform control. -- Dave Hargis, Microsoft Access MVP "Shiller" wrote: > Experts, >...

Continuous Form 11-17-07
I have a Dashboard with a subform that is a continuous form. The subform is a summary list of all audits in the database. I want the user to be able to click on the audit number listed in the subform and have another form "frmAA" open filtered to that particular audit and ready for editing. I've seen attempted solutions posted but results have been either the frmAA opening to a blank record or opened to a particular audit regardless of the audit that was selected. Thanks in advance, kljohn should be easy enough. the audit table has a primary key field, correct? and tha...

Update from gridView ItemTemplate 07-17-10
I have a simple GridView with multiple columns from a Sql table. I have only 1 data column that I want to update (a date column) without having to have the user click an Edit button, edit the date and click the update button. I have the GridView wrapped in an UpdatePanel and have the code below in the TextChanged event of the TextBox. I think it may work if I can get the key value of the row I am on. Any help is appreciated. Thanks. Protected Sub txtCompleteDate_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Dim intKey As Int32 = 0 Di...

Email to Queue 11-28-05
Is there anyway to have MS CRM use internal email addresses instead of external to create items in a queue? Are you asking if an internal user can send an email to a CRM queue? -- Matt Wittemann http://icu-mscrm.blogspot.com "CRM Question" wrote: > Is there anyway to have MS CRM use internal email addresses instead of > external to create items in a queue? ...

Use values from a form as criteria in a DSum
Hello All, I have a report in which the end user selects a single person or multiple people from a form and then I store their selection(s) in a temp table (ttmp_Prn_Isu). I have a report that uses this temp table as its datasource so that I can sort and group it properly. All the fields are populated via DSum function because the final report resembles a crosstab report that may contain rows with no data and yet the rows still need to be seen. My difficulty is in referencing the personID stored in the temp table ([ttmp_Prn_Isu].[IsuNm]) as criteria in my DSum function. I also have...