Forum Discussion

MrPatrick's avatar
MrPatrick
Icon for Helper I rankHelper I
4 years ago
Solved

Restricting data import by date - MySQL

I've got a database where all the tables go back to ~2013 but I'm only interested in the last 12 months. Currently I either import the whole lot and then filter it (which is incredibly slow and prone...
  • jdbuchanan71's avatar
    4 years ago

    MrPatrick 

    Why not make the start date dynamic on your query?  In T-SQL it would be.

     

    WHERE Event_Date >= DATEADD(MONTH,-12,CONVERT(DATE,GETDATE()))