I want to use the date add function in this sql query I have. I tried multiple ways of formatting it, but I can't get it to work. This is one of the ways I tried it: VB.net mySQL How to use DateAdd in sql query
Below is the query I have.
sql.runquery("Select th.Thickness, odo.OptionCode
From FVMASTER..trackinghistory th
Join FVMASTER..OrderDetailOptions odo on odo.odKey=th.odKey
Join FVMASTER..MasterPartOptions mpo on mpo.Code=odo.OptionCode And mpo.[Group]=odo.optiongroup And mpo.QuestionKey='KGLASS' and OptionType=5
where th.DateTime >'"date_added = DATE_ADD(date_added,INTERVAL -4 DAY)")
This might also interest you. This is declared above the query.
Dim dtimeStartDate As DateTime = GetWeekStartDate(tbWeek.Text, tbYear.Text)
Dim dtimeEndDate As DateTime = DateAdd(DateInterval.Day, 7, dtimeStartDate)