Forum Discussion
VivekKakkoth
4 years agoNew Member
Query Data for a Specific Date
Hi , I am new to Power Bi and I am trying some reporting stuffs with Power BI. I am trying to query some data from a DB2 database which I have connected via the ODBC connections. My requireme...
- 4 years ago
Hi VivekKakkoth
Try using CURRENT DATE instead. Specifying CURRENT_DATE is equivalent to specifying CURRENT DATE.
SELECT * FROM tablename WHERE date = CURRENT DATEReference: https://stackoverflow.com/questions/32478642/how-to-select-data-from-db2-for-current-date
In addition, Current date is in
yyyy-mm-ddformat. If your date column is in other format, you may need to convert its format. Please refer to https://stackoverflow.com/questions/10320918/db2-date-formatBest Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
BA_Pete
4 years agoSuper User
Hi VivekKakkoth ,
In Power Query M, you would bring in all the data, then filter as follows:
Table.SelectRows(
previousStepName,
each [date] = #date(2022, 05, 01)
// OR: each [date] = variableName to use a defined variable
// OR: each [date] = Date.From(DateTime.LocalNow()) to use today's/current date
)
Pete