Q. Show via query how many days remain until Christmas. Round fractional days up using the numeric function ROUND.
Answer :-
Here we can use DATEDIFF( ) function. By Round ( ) method it become very complex.
So, Query is
SELECT DATEDIFF ( '2021-12-25' , curdate ( ) ) ;
PLZZ tell me the answer of this question . It is not visible
ReplyDeleteOk, I will upload it very soon.
DeleteWhere is the answer please upload it asap
ReplyDeletePlease Check again.
DeleteSELECT ROUND(DAY('2021–12–25')-DAY(CURDATE()));
ReplyDeletethen days will act like integers and you will not get result
Deleteselect dayofyear('2024-12-25')-dayofyear(sysdate())-Round(((hour(curtime())*60*60)+(minute(curtime())*60)+(minute(curtime())))/(24*60*60)) "Days to Chrisitmas";
ReplyDeleteThis i thought...
complex i think... round ke andar wala function is for the following purpose: find the second of day(number of hours passed*60*60+minutes*60+secinds) and if more than 12 hours have passed , then the value returned is 1.
Deleteinitial part se number of days left aaega
instead we can just use: round(hour(curtime())/24)
DeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )