text TO lcSQL TEXTMERGE noshow select COUNT(ID) as conflicts from dbo.max4sale where <<thisform.cWhere>> AND Start_Time >= <<VFP2SQL(m.ltBegin + m.lnStartTime)>> and Start_time <= <<VFP2SQL(m.ltEnd)>> AND CONVERT(varchar(5),Start_Time,108) <= <<VFP2SQL(m.lcEndTime)>> AND CONVERT(varchar(5),End_Time,108) >= <<VFP2SQL(m.lcStartTime)>> <<m.lcDays>> ENDTEXTand my current code is
// Set the initial query to find overlapping times. var query = this._siriusContext.Max4Sale.Where(m4s => m4s.StartTime >= beginTime && m4s.StartTime <= endTime && m4s.Id != max4sale.Id && m4s.Type == max4sale.Type); if (!String.IsNullOrEmpty(cStartTime)) { query = query.Where(m4s=>m4s.StartTime.Value.ToShortTimeString() <= endTime.ToShortDateString() && m4s.EndTime.Value.ToShortTimeString() >= beginTime.ToShortDateString()); }which is wrong, obviously. I am wondering if you can suggest what should I use instead.
List<DayLimit> dayLimitsDayLimit class is the following:
public int MaxSaleLimit { get; set; } public string DayName { get; set; } public bool Selected { get; set; } public short WeekDay { get; set;}so, my list is populated with
' AND DATEDIFF(Day, 0, Start_Time) % 7 IN (' + m.lcDays + ')'
where lcDays was a string of (0,1,3) etc.