Home > database >  How database query every Friday after 10 o 'clock next Friday before 10 o 'clock submit li
How database query every Friday after 10 o 'clock next Friday before 10 o 'clock submit li

Time:10-19

The second line below is associated with individual staff table

CodePudding user response:

Said fully understand this period of SQL with you have what relation, the problem of query oa_dailyp dcrectetime plus two in table data is equal to the current time, merge oa_ry ccode is not in the table above that the data in the query results, the problems do not have what relation with you

CodePudding user response:

引用 1 楼 听雨停了 的回复:
表示完全没看懂这段sql跟你的问题有啥关联呢,查询oa_dailyp表中dcrectetime加上两个表示等于当前时间的数据,合并oa_ry表中ccode不在上面那个查询结果中的数据,这跟你的问题没啥关系吧
这是我写的一个判断当天晚上10点后到第二天10点前的,我就想问问周五晚上10点后到下周五晚上十点前的怎么写

CodePudding user response:

Determine the time in the where clause for your weekly code to try the following

 
DCREATETIME BETWEEN the CONVERT (VARCHAR (10), DATEADD (DAY, 1 * (DATEPART (WEEKDAY, GETDATE ()) - 6), GETDATE ()), 121) + '10:00:00',
AND the CONVERT (VARCHAR (10), DATEADD (DAY 7, DATEADD (DAY, 1 * (DATEPART (WEEKDAY, GETDATE ()) - 6), GETDATE ())), 121) + '09:59:00'


CodePudding user response:

reference RINK_1 reply: 3/f
your weekly judgment to try the following code in the where clause for time

 
DCREATETIME BETWEEN the CONVERT (VARCHAR (10), DATEADD (DAY, 1 * (DATEPART (WEEKDAY, GETDATE ()) - 6), GETDATE ()), 121) + '10:00:00',
AND the CONVERT (VARCHAR (10), DATEADD (DAY 7, DATEADD (DAY, 1 * (DATEPART (WEEKDAY, GETDATE ()) - 6), GETDATE ())), 121) + '09:59:00'




Wrong, it is daily

CodePudding user response:

reference RINK_1 reply: 3/f
your weekly judgment to try the following code in the where clause for time

 
DCREATETIME BETWEEN the CONVERT (VARCHAR (10), DATEADD (DAY, 1 * (DATEPART (WEEKDAY, GETDATE ()) - 6), GETDATE ()), 121) + '10:00:00',
AND the CONVERT (VARCHAR (10), DATEADD (DAY 7, DATEADD (DAY, 1 * (DATEPART (WEEKDAY, GETDATE ()) - 6), GETDATE ())), 121) + '09:59:00'


I this is daily, weekly don't know how to judge the

CodePudding user response:

reference 5 floor adminabc123 reply:
Quote: refer to the third floor RINK_1 response:
your weekly judgment to try the following code in the where clause for time

 
DCREATETIME BETWEEN the CONVERT (VARCHAR (10), DATEADD (DAY, 1 * (DATEPART (WEEKDAY, GETDATE ()) - 6), GETDATE ()), 121) + '10:00:00',
AND the CONVERT (VARCHAR (10), DATEADD (DAY 7, DATEADD (DAY, 1 * (DATEPART (WEEKDAY, GETDATE ()) - 6), GETDATE ())), 121) + '09:59:00'


I this is daily, weekly don't know how to judge the


To me this, and see if it is weekly,

CodePudding user response:

refer to 6th floor RINK_1 response:
Quote: refer to the fifth floor adminabc123 reply:

Quote: refer to the third floor RINK_1 response:
your weekly judgment to try the following code in the where clause for time

 
DCREATETIME BETWEEN the CONVERT (VARCHAR (10), DATEADD (DAY, 1 * (DATEPART (WEEKDAY, GETDATE ()) - 6), GETDATE ()), 121) + '10:00:00',
AND the CONVERT (VARCHAR (10), DATEADD (DAY 7, DATEADD (DAY, 1 * (DATEPART (WEEKDAY, GETDATE ()) - 6), GETDATE ())), 121) + '09:59:00'


I this is daily, weekly don't know how to judge the


To me this, and see if it is weekly,
thank you! Try to knock off tomorrow

CodePudding user response:

Brother ah share your weekly journal, how to realize the younger brother I now also doing this function is difficult to me now on the database design with a timer task set weekly day weeks, please give directions!
  • Related