I want to SELECT data dynamically depending on the period that I am on. For instance, I have 2 columns in my table that defines the period that I am currently on: YEAR and PERIODID, were PERIODID is the month that i'm on in a numeric format (January = 0, february = 1 , etc).
For example, in the following query i will be selecting data for my current period (July 2015):
SELECT account, customer, balance FROM Table1 WHERE PERIODID = 6 AND YEAR = 2015
is there a way to populate these parameters dynamically depending on the current date?