Meta query woes!

I am using ACF but have been told this is a Bricks question.

I have a CPT ‘Productions’

‘Productions’ has a custom DATE field ‘production_date’

I am building a single post template for ‘Productions’

As well as a single ‘Production’, in that template I want to show a loop of the other ‘Productions’ happening on the same ‘production_date’.

I think I should be using the Meta Query BUT cannot see how.

I ‘think’ the problem is the Meta Value, as I don’t know what to do there
I have tried various Meta ‘keys’ -
production_date
acf_additional_production_information_group_production_date
additional_production_information_group_production_date
{acf_additional_production_information_group_production_date}
Meta Value ?
Compare - EQUALS
Type - DATE

I have tried to resolve this for over a week now, trying to get help from various online resources but no joy…and its killing me :slightly_smiling_face:

Can someone please show me how to do this. Maybe the best way is to write a little PHP Query to add into the Query Editor (PHP)

Here is a video explaining the setup and issue:

https://vimeo.com/982974272/e4d63657bd

If I need to pay for this to be done I am happy to do so.

Thank you all

As per this post: Show only dates within a certain month with Query Loop and ACF Date Picker

Dates can be a pain… there may be better ways, but I just leave them as default ACF (which is Ymd) and treat them as a number… so in the ‘related’ loop -
META EQUALS {prod_date} Type numeric
The field_name can be just the field name, since it’s stored as post meta (no acf_ unless you called the field acf_etc.).
However… you will need to get the date from the current post, store it, and then used it in the related loop. So a PHP snippet something like:

function my_thing {
$current_prod_date = get_field('prod_date', get_the_ID()); // Assuming 'prod_date' is the ACF field 
return $current_prod_date;
}

then in the custom query:

$prod_date = {echo:my_thing};
return [
    'post_type' => 'post',
    'posts_per_page' => 5,
    'meta_query' => [
        [
            'key' => 'prod_date',
            'value' => $prod_date,
            'compare' => '='
        ]
    ]
];

However, I’m a bit vague on getting/passing the variable - if you can use PHP in the array editor. So this may not work, but it’s the approach you will need. Get current post_id, fetch acf_field, use acf_field in custom meta_query as Ymd with numeric compare.