* from EMP WHERE (Year (now ())-year (hiredate)) >=30/* Get age of 7369 */SELECTDATEDIFF("1981-1-17", "1980-12-17");SELECT DATEDIFF (now (), emp.hiredate)/365 from emp WHERE empno=73695. Conditional Functionsifnull (x, y)If the value of x is null, replace with the value of Yif (expr,x,y)Returns the result if the expression expr is true x otherwise returns ySelect IF (1>0, "correct", "error")6. System Information FunctionsIP Address Conversion/* Convert
1, first, introduce the TO_CHAR functionTo_char is to convert a date or number to a string and cannot specify a string length.Use the TO_CHAR function to process the date:To_char (number, ' format ') For example: To_char (Salary, ' $99,999.99 ')Use the TO_CHAR function to process the date:To_char (
For interaction, we should select Js for implementation, which is also the first test of Pair programming. I will write the display part in html, and click the button to trigger the event function as check ();
Copy codeThe Code is as follows:Function onCheck (){Var Year = document. getElementById ("year "). value; // obtain the "Year" var theYear = Year * 1 of the text box; // convert it to the number type
Date format:The date format queried in the database may not be the format we want to display, such as timestamp display to the nanosecond level. Here are two of the kinds I used.Two ways to specify the date format: the first, the SQL to convert, and the second, the cell display format to set. It is recommended that the
1. Calculate the birth date, age, and gender (18 digits) based on the ID card number)
Copy codeThe Code is as follows: // obtain the ID card number
Var UUserCard = $ ("# UUserCard"). val ();
// Obtain the Date of birth
// UUserCard. substring (6, 10) + "-" + UUserCard. substring (10, 12) + "-" + UUserCard. substring (1
Applies to the management of archives in OA projects.
1. Calculate the birth date, age, and gender (18 digits) based on the ID card number)CopyCodeThe Code is as follows: // obtain the ID card numberVaR uusercard = $ ("# uusercard"). Val ();// Obtain the Date of birth// Uusercard. substring (6, 10) + "-" + uusercard. substring (10, 12) + "-" + uusercard. subs
Applies to the management of archives in OA projects.1. Calculate the birth date, age, and gender (18 digits) based on the ID card number)Copy codeThe Code is as follows:// Obtain the input ID numberVar UUserCard = $ ("# UUserCard"). val ();// Obtain the Date of birth// UUserCard. substring (6, 10) + "-" + UUserCard. substring (10, 12) + "-" + UUserCard. substrin
1. Calculate the birth date, age, and gender (18 digits) based on the ID card number)Copy codeThe Code is as follows:// Obtain the input ID numberVar UUserCard = $ ("# UUserCard"). val ();// Obtain the Date of birth// UUserCard. substring (6, 10) + "-" + UUserCard. substring (10, 12) + "-" + UUserCard. substring (12, 14 );// Obtain genderIf (parseInt (UUserCard.
You want to connect the three cell contents of the diagram to one another.If you connect directly, the date is converted to a number, and the currency has no delimiter between the characters.Date connections can take two ways:1. Convert the date to text.2. Use year, month, day to extract time after the connection.The c
1, seconds is the number of seconds relative to the 1970.1.1 number2. The date module has time, datetime3.Import= datetime.datetime (0, 0, ten, respectively) is year, month, day, hour, minute, second, subtle (10-6 seconds) print (T- Datetime.datetime (1970,1,1)). Total_seconds () total number of secondsImport datetime,time >>> t = datetime.datetime (0, 0)>>> t
Compile a simple calendar. Enter the date to be searched in the text box. The program can calculate the week number of the day in the year and determine the day number of the week. For more information, seeFor interaction, we should select Js for implementation, which is also the first test of Pair programming. I will write the display part in html, and click the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.