Crosstab Query (1 Viewer)

crislim1113

New member
Local time
Today, 21:48
Joined
Jan 27, 2021
Messages
19
Hi good day to all. in my crosstab query. i want to include the sorted out requested delivery date(but it will not show). It was like slicer in excel.
this is my query

1612167856610.png

1612167951409.png


and here is the combobox where i will choose the month. Can someone help me with these. It will be greatly appreciated.

Regards,
Cris
 

Rene vK

Member
Local time
Today, 15:48
Joined
Mar 3, 2013
Messages
123
You don't have RequestedDeliceryDate in your query and for the combo, just make a list! januari; februari; march; etc
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 21:48
Joined
May 7, 2009
Messages
19,233
what is the Rowsource of the Combo?
does the combobox also have Year?
 

CJ_London

Super Moderator
Staff member
Local time
Today, 14:48
Joined
Feb 19, 2013
Messages
16,607
perhaps include the month of the delivery date in your cross tab query

expr1:month([requestedDeliveryDate])

change the Total row to 'WHERE'

in criteria put something like

forms!mainboard!cboMonth

note you also need to declare the reference in parameters - on the ribbon, select the parameters button and add it in there - presumably as type integer (1 for january)

If it is text (i.e. January) then declare it a text

You will no doubt also need some way of stating the year as well, but not at all clear from your data how you might do that
 

crislim1113

New member
Local time
Today, 21:48
Joined
Jan 27, 2021
Messages
19
what is the Rowsource of the Combo?
does the combobox also have Year?

This one sir.. I think I must add year combo sir?

Regards,
Cris
 

Attachments

  • 1612168867191.png
    1612168867191.png
    142.6 KB · Views: 144

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 21:48
Joined
May 7, 2009
Messages
19,233
you can have a single combo for Month-Year.
or you can add another combo for the Year.
 

crislim1113

New member
Local time
Today, 21:48
Joined
Jan 27, 2021
Messages
19
perhaps include the month of the delivery date in your cross tab query

expr1:month([requestedDeliveryDate])

change the Total row to 'WHERE'

in criteria put something like

forms!mainboard!cboMonth

note you also need to declare the reference in parameters - on the ribbon, select the parameters button and add it in there - presumably as type integer (1 for january)

If it is text (i.e. January) then declare it a text

You will no doubt also need some way of stating the year as well, but not at all clear from your data how you might do that
Hi Sir,
am I doing it right?
1612169314216.png


Please bear with me ..

Regards,
Cris
 

crislim1113

New member
Local time
Today, 21:48
Joined
Jan 27, 2021
Messages
19
Hi Sir,

I would like to export only the month of the current year. I think I will put another field for year only..
Thanks
you can have a single combo for Month-Year.
or you can add another combo for the Year.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 21:48
Joined
May 7, 2009
Messages
19,233
if the intention is for the Current year only, forget the Year-combo.
if others will be using the db, just guide the user that the xtab is for the currentyear only.

create New Column on your xtab query (and show it as another Row Heading):

Expr1: MonthName(Month([requestedDeliveryDate])) & "-" Year(Date())
Criteria: [Forms]![YourForm]![yourCombo] & "-" Year(Date())
 

crislim1113

New member
Local time
Today, 21:48
Joined
Jan 27, 2021
Messages
19
if the intention is for the Current year only, forget the Year-combo.
if others will be using the db, just guide the user that the xtab is for the currentyear only.

create New Column on your xtab query (and show it as another Row Heading):

Expr1: MonthName(Month([requestedDeliveryDate])) & "-" Year(Date())
Criteria: [Forms]![YourForm]![yourCombo] & "-" Year(Date())
Hi sir, it does work in my other query, but not in my crosstab.. sir am I correct? btw thank you very much sir
1612230488811.png
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 21:48
Joined
May 7, 2009
Messages
19,233
remove the new Row Heading, instead use "requestedDeliveryDate" as the Row Heading.
 

crislim1113

New member
Local time
Today, 21:48
Joined
Jan 27, 2021
Messages
19
Hi sir ,
Like this? it doesn't go to datasheet view sir. thanks
1612245630565.png
 

Users who are viewing this thread

Top Bottom