Output Particular Group In Query - URGENT
Jan 5, 2006
Hi Folks,
I have a table that has Student_ID, Course, and Grade. So each student has multiple records, one for each course they took. But what I want to return is only those people who have All F's. If I just put "F" as a criteria on the grade field then it will pump out those records that have an F, including those who maybe only have 1 F, but all I want is a list of Student_ID's of all of those people who have nothing but F's. Any ideas? HELP..i'm really in a bind with this one.
View Replies
ADVERTISEMENT
Oct 17, 2005
I have designed an application in Access with an SQL backend.
How do I determine the user logged into SQL from within my Access application.
Specifically what stored procedures can i use to determine
1. The user name
2. The user's group(s)
of the currently logged-in user.
I would appreciate any other techniques for solving this problem
Thanks.
Peter.
Nigeria
View 1 Replies
View Related
Aug 20, 2013
I'm using Access 2007 SP3.
Whenever I export reports to PDF, the output appears zoomed and clipped. No extra pages are generated as they would be if I'm going over margins, it's just the report is clipped.
The report looks perfect in preview mode, and it looks perfect when going to an actual printer. However, when using OutputTo to save it as a PDF, this is when the report content is clipped.
Here is the code I'm using:
DoCmd.OpenReport MyReport, acViewPreview
DoCmd.OutputTo acOutputReport, "", acFormatPDF, "MyReport.pdf"
DoCmd.Close acReport, MyReport
I open the report in preview mode first so events are fired that show/hide various objects based on fields in the recordset.
I've tried reinstalling, and I've tried this on two different machines, one running Windows 7 and one running Windows Server 2008...both with the same results.
View 5 Replies
View Related
Sep 18, 2006
Hi,
I had a query which used to work perfectly fine, then I changed one of the field names that the query was returning. And then, I rechanged the same field back to what it was and I save it. Later, whenever I run that query, it asks for a parameter with the same field name I changed even though I don't have it anymore.
Any suggestions why this is happening please!!!!
Regards,
B
:mad:
View 7 Replies
View Related
Mar 13, 2007
I have written 2 SQL queries which I wanted to combine using IF-Then statement, if possible.
the first one:
SELECT NewNumber as [Main_number]
FRom try_SQL
Where Type='A' OR type ='V'
The second one is:
SELECT OldNumber as [Main_number]
FRom try_SQL
Where Type<>'A' AND type <>'V'
I want to output the Main_number as a text file on my D drive.
At the moment I have to to output 2 different text files, then combine them.
can someone please help me?
View 4 Replies
View Related
Sep 1, 2005
Hi,
Can some one please tell me how I can use a delete query. I have the following code, but it does not work. Please let me know where I am going wrong
---------------------------------
Dim StrSQL As String
StrSQL = "Delete FROM PLANT WHERE PLANT_CODE = ' " & PLANT_CODE_txt & " ' "
DoCmd.RunSQL StrSQL
----------------------------------
In the above and below code PLANT_CODE_txt is the form field that I am taking values from to delete from the table
(or)
----------------------------------------
Dim StrSQL As String
dim pt_code as string
pt_code = me.PLANT_CODE_txt
StrSQL = "Delete FROM PLANT WHERE PLANT_CODE = ' " & pt_code & " ' "
DoCmd.RunSQL StrSQL
--------------------------------------------------------------
And if we are using multiple delete queries should we have the DoCmd.RunSQL <variable> after every delete statement or is it after all the statements
Thanks
View 7 Replies
View Related
Jun 5, 2006
Hi All,
Can anyone help me count postcode instances. I have a query that looks at my customers table (tbl_Customer_Details) post code field (PostCode), at the moment I have got it to strip out the right side of the postcode leaving me the left district side eg. HG12 8EN becomes HG12. I would then like to count how many times each postcode instance occurs so I can create a report on the result so I can track which district the customers are coming from. I hope this explains the problem. Any help would be much appreciated as I promised the Boss this for tomorrow....:confused:
this is my SQL so far, it strips out the left of the postcode:
SELECT tbl_Customer_Details.PostCode, Left([Postcode],4) AS Code
FROM tbl_Customer_Details
GROUP BY tbl_Customer_Details.PostCode;
What do I add to do the count?
View 5 Replies
View Related
Feb 25, 2008
Original Table
ozip dzip shipdate wgt Transport cost
A B 12/1/07 20 450
C D 4/1/08 15 890
E F 9/1/08 78 750
A B 12/1/07 42 789
X Y 1/1/08 17 900
C D 4/1/08 34 90
Needed Output
ozip dzip shipdate wgt Transport cost
A B 12/1/07 20 450
A B 12/1/07 42 789
E F 9/1/08 78 750
I need to create a query which extracts rows with wgt >60 and also WHEN the fields ozip, dzip and shipdate are same, the query should add the wgts and then sum of wgts should be >60- for example the first and fifth rows should be extracted since sum is 62.
I have attached the output that is required for the above example. please help
View 1 Replies
View Related
May 4, 2006
Hi,
I have a select query that selects certain customer email addresses and
I want to output the results as csv, which can be used directly in a "To:" field to create a group email.
The SQL of my query is:
SELECT [Customer Details].[Email Address]
FROM [Customer Details] INNER JOIN [Orders] ON [Customer Details].[Customer ID] = [Orders].[Customer ID]
WHERE ((([Orders].[Licence Declaration])=No) AND (([Orders].[Licence Status])="Unlicensed"));
I have found some SQL code on the internet as follows:
"SELECT Field1, field2 FROM table WHERE field1='" & [FORM]![PARAMETER] & "';"
but adapting my code with that is a little bit beyond me...can anyone help?!
Cheers,
Dave
View 3 Replies
View Related
Aug 16, 2007
Hi,
I have a query which pulls key fields from a Table and exports to an excel file through the Output to cmmd.
In the table, i have defined a few fields with Look-up criteria and Combo / LIsts. When the Excel sheet is created the Lists are not downloaded. The purpose is to scrub the data and provide users an excel sheet for update of the Combo box for upload in another MS access table.
Please help, this feature is extremely critical for our work. Thanks in advance.
View 1 Replies
View Related
Oct 31, 2005
Hi,
I have an indexed table (unique autonumber) in Access. I have in this table an other column with every X rows a number (X varies) and the rest of the rows below are empty. This situation repeats again with another number and again all the fields under it are empty. Is there a possibility to run an update query to update all fields below to that certain number? Can you define a range (by using a range in the autonumber) to update all the fields in that range to that specific number ??
PLEASE HELP!! :(
Thanks!!!
Cheers,
View 2 Replies
View Related
Mar 29, 2005
How can I get the record with a date field that is the earliest and the latest in a table.
tblSample(ID, Name, Type, ItemDate)
The ItemDate can be any date entered by the user, so the ID will not give me the earliest and the latest record. How do I make a query that will give me the earliest ItemDate and the latest ItemDate. I need to do this in Access. Thank you.
View 1 Replies
View Related
Oct 8, 2006
Why is this querry giving me an error in syntax??
I am doing this...
set db=Currentdb
strSQL="insert into processus id= '" & txt_id.Value & "', libelle = '" & txt_libelle.Value & "',version= '" & txt_version.Value & "',type= '" & cmb_type.Value & "',cle_tri= '" & txt_cle_tri.Value & "' "
db.execute strSQL
I think this is right, but it gives me a message saying "error in INSERT syntax"
Thanks in advance
View 2 Replies
View Related
Oct 18, 2006
Hello, I’m pretty bad with VB code but I need something pretty simple. I have a button on my form and when I click it I want it to run a query and output a certain field value to a label. I know I’ll need VB code for this, so any sample code would help a ton!
View 4 Replies
View Related
Nov 19, 2004
Could someone tell me how to put the out put of a query into a textbox in a form.
I have asked this question on a couple of other sites but I still cant figuer this out.
I am a beginner so please make and easy explanation.
thanx
View 4 Replies
View Related
Jan 5, 2006
I am trying to create a sequential number field in a query. I cant use an auto number for the fact that i am combining multiple tables. Any help with this would be greatly appreciated.
View 14 Replies
View Related
Feb 7, 2006
Hi,
Not able to add more column heading in cross tab query.
I tried to change the query properties to add more column headings as given below.
In the query's Design view, right-click up in the area where your tables are shown and choose "Properties" from the right-click menu. The 3rd line down is for Column names. Enter what you need there.
Evn after doing it. i am not able to .
Whn I try to save or view the datasheet it says. to create a crosstab query u need to have one or more row headin one column headin and one value.
please help. its ver urgent.
thanks in adv..
View 1 Replies
View Related
Aug 6, 2007
Hi all, i need some help constructing a query that will create a table for me that does not include the Type value of 'promotion' if the same ID value exists elsewhere within the query.For instance, in the example below, i would want to delete the first entry containing 'Promotion' because ID2001 exists in two other places. However, if only one instance of ID2001 'Promotion' existed in my query, i would want to keep that entry. I would prefer to write all my data to a new table called "Test", This query has to sort out about 1000 entries when executed, otherwise i'd do it manually.I'm pulling my hair out with this one, so could someone help me?ID Company Name TypeID2001 Disc plc John PromotionID2001 Disc plc Paul AgentID2001 Disc plc George Agent
View 3 Replies
View Related
Oct 18, 2007
is it possible to automatically output the results of a query to notepad?
View 2 Replies
View Related
Aug 30, 2005
Windows XP Pro/Office 2000
I was able to output to excel before fine, now all of a sudden I cannot. I keep getting a message when I go Tools>Office Links>Analyze with MS Excel:
"Cannot access "xxxvac_Inv_DBQuery.xls"
It's wierd. It won't output the data, but it still creates the spreadsheet file.
Any Idea's?
Thanks to all in advance, your help is greatly appreciated! :(
View 1 Replies
View Related
Feb 13, 2007
Hi Guys,
I have 2 tables
tblXRFResults
ResultID
SampleName
Date
SampleDate
a few others not necessary in this
and tblXRFResultsConcentration
ResultID (many records linked to 1 record in tblXRFResults)
Concentration
CompoundName
What I need to set up is a query that will allow me to generate a report that will give an excel like format, with the column headings being the SampleName, followed by the CompoundName(s) from the other table and the "rows" will be corresponding sample name and concentrations.
I am sure this is pretty easy, but I am stumped!
Any help would be greatly appreciated.
View 6 Replies
View Related
Oct 26, 2007
along with data in each row, i want to include the record number in the ouput of a query. is it possible?
once i run the query and view the ouput, i can see the standard access database record counter at the bottom or if i select a row, i can see the row number at the bottom.
how can i include that counter in each row of output from the query?
View 1 Replies
View Related
Sep 30, 2014
Im trying to output my VBA code to a report.
Here is my code:
Code:
Dim strEmployeeName As String
strEmployeeName = EnUsername
DoCmd.RunSQL "SELECT StrConv(Replace([sUser],""."","" ""),3) AS Employee, TimesheetTable.Activity, TimesheetTable.Hours, TimesheetTable.Description, TimesheetTable.[Task Date], TimesheetTable.ProjectRef " & vbCrLf & _
"FROM TimesheetTable " & vbCrLf & _
"WHERE (((StrConv(Replace([sUser],""."","" ""),3)) Like """ & strEmployeeName & """) AND ((TimesheetTable.[Task Date])>=#" & [Forms]![DateSelection_Frm]![txtWeekCommencing] & "# And (TimesheetTable.[Task Date]<= #" & [Forms]![DateSelection_Frm]![txtWeekEnding] & "#)) AND ((TimesheetTable.ProjectRef) Not Like ""CENG*""));"
And my report is called TimeReport.
View 1 Replies
View Related
Mar 15, 2015
I want to get the output of a vba query (only one solution possible) in to a variable but the variable stays empty.
Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset("SELECT info FROM evaluationtable WHERE evaluation= " & evaluationchoice & " ")
var = rst(0).Value
rst.Close
some explination: evaluation and info are fields of evaluationtable evaluationchoice is a field in an accessform where I can choice a value from the evaluation field
the table is build as this (only two fields) evaluation - info
View 5 Replies
View Related
Dec 12, 2013
I have a field in a query that shows amount of hours a site is covered. This field name is Coverage hours and it changes depending on the number of work days in a month. This part is working correctly but some times additional hours may be requested by the customer.
I want to add a another field to this query that will prompt me if their were any additional covered hours. Then I would have the ability to enter a value and the shown output for this field would be the value entered plus the standard coverage hours in the other field.
I'm not sure how to set up the new field.
View 10 Replies
View Related
Feb 13, 2014
I am trying to modify the output to only show discontinued items. While the query is in datasheet view, the text is read as "YES" or "NO" under discounted items. So, I tried entering "YES" in criteria while in design view, but keep getting an error message stating, "Data type mismatch in criteria expression".
View 5 Replies
View Related