#Giovanni-Sigma

1 messages · Page 1 of 1 (latest)

tall trail
#

Hi there! So to clarify you are asking how to grab the current date within Sigma so that you can figure out the 1st and 16th of the month?

mild birch
#

yes

tall trail
#

Alright I'm not super familiar with Sigma. Give me a moment and let me see if I can figure this out

mild birch
#

yes and no -
so I need to pass a value that’s 1st and 16th of the month
I was thinking I can get there by pulling the current year and month from the current date (i figured this part out)
and then create a datetime by passing 1 or 16 in the day. But I’m struggling with how to pull together the year/month/day together

tall trail
#

Ah okay what are you trying right now that isn't working?

#

it should be yyyy-mm-dd I believe

mild birch
#

where I’m having trouble is with passing the right dates. I was trying to grab the current month and year from current_date and reconstruct a datetime by adding days

but something like datefromparts() doesnt work in Stripe’s SQL stack

#

do you know of alternatives to datefromparts?

tall trail
#

I don't off top of head

mild birch
#

im trying to do somethin like this
and cai.status_transitions_paid_at >= datefromparts( year(current_date()), month(current_date()), 1)
and cai.status_transitions_paid_at <= datefromparts( year(current_date()), month(current_date()), 16)

#

but that function doesnt work. so i was wondering if you knew of other sql functions or approaches that would solve for this

tall trail
#

Yeah sorry, this is outside my SQL knowledge. I'd recommend asking our Support team as they have some Sigma experts that should be able to help you for what functions Sigma specifically supports here.

mild birch
#

ok thank you very much