ms-access


Pivot combo box table in ms access


I am using this SQL:
TRANSFORM Max(table1.[quiz]) AS MaxOfquiz
SELECT table1.[quizdate], table1.[studentname], Max(table1.[quiz]) AS [Total Of
quizscores]
FROM table1
GROUP BY table1.[quizdate], table1.[studentname]
PIVOT table1.[coursename];
To try and pivot a combobox table:
Table1
ID quizdate coursename studentname quiz
1 02-Jan-21 math john 100
2 03-Feb-21 science joe 99
3 04-Mar-21 physics monica 97
4 05-Apr-20 language mike 88
Where coursename is a dropdown (math, science, physics, language) into
Table 2
studentname math science physics language
john 100
joe 99
monica 97
mike 88
I got these results:
quizdate studentname Total Of quizscores 1 2 3 4
4/4/2016 moe 88 88
1/1/2017 john 100 100
2/2/2017 joe 99 99
3/3/2017 monica 97 97
It seems that combox box coursename can't be pivoted as column name, but the
numbers instead. Can anyone explain how I can generate the correct results?

You answer it yourself:
Where coursename is a dropdown (math, science, physics, language)
So, in the query, the value from the field will be the ID of these "dropdowns".
To obtain coursenames, move these to a separate table and join this with Table1 in your query.


Related Links

SQL Query to retrieve Item name and sum of amounts for that item
Query missing data from select fields for only 2 records
Microsoft Access - Search Query
Like with IIF and date range not returning results
OPening multiple copies of ACCESS app
Access New ID Field YYYYMMNN [duplicate]
Sequential Number Column with YYYYMM
I am trying to get the correct font size for my subform in Access
Start and stop MS Access VBA code on a specific time
Table Joining (ms Access, sql)
Howto write DDL ALTER TABLE Modify statement using string variable for TABLE name
Filter combobox: how to add “NOT filtered” option?
access 2010 form new record pre filled button
Azure SQL authentication with Office 365 Account
Microsoft Access displays both months and years differences
Combine several records with 1 id into 1 record in Access

Categories

HOME
winforms
tizen
plone
office365api
sd-card
razor
tizen-web-app
jgroups
gps
icloud
retrofit
windows-server
qore
autotools
gitpitch
adobe-analytics
fancybox-3
postgres-xl
hapi
clearcase-ucm
after-effects
oracle-coherence
jasonette
realex-payments-api
firebase-crash-reporting
kendo-datasource
react-chartjs
stormpath
data-manipulation
airconsole
jspresso
lxd
ghost4j
io-redirection
suricata
hockeyapp
espeak
objectlistview
twitch
galen
sencha-touch-2.3
websphere-mq-fte
logfiles
xml-documentation
network-flow
chain-builder
blogengine.net
powercli
crypt
background-service
objective-c-swift-bridge
messenger
android-textview
log4c
adxstudio-portals
mongocsharpdriver
impresspages
rvest
wapiti
photobucket
hsv
dukescript
graph-api-explorer
csquery
offloading
file-copying
multiprocessor
cdc
gwt-rpc
hungarian-algorithm
typoscript2
cisco-jtapi
osql
whoosh
gnu-prolog
libc++
psi
telerik-scheduler
visitor-statistic
jquery-ui-droppable
mirah
webkit.net
memory-size
eqatec
xetex
phonon
noscript
text-coloring
msdev
ugc
lzh





Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm