Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I need to display the list of staffs who check into work late in a week. For example the staff checks in at 8.10 when the supposed check in time is at 8.00 AM. I am using datetime for the datetimein and datetimeout field. Can anyone suggest how should I do it?
Well, with no sample tables to work from, it's hard to give a clear answer. But I think what you're looking for is the TIME() function.
This should get you started in the right direction:
SELECT * FROM timeclock_records where TIME(datetimein) > "08:00:00";
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 days ago.
Improve this question
Screenshot of the problem provided
Was expenting output of Line 4 and Line 8 should be similar whereas experiencing difference .
Hard to tell without the source data, but I'm guessing that some students have a null for hrs_studied. Most aggregate functions skip nulls, but count(*) does not. If you replace the count(*) with a count(hrs_studied), you should get the same result as `avg(hrs_studied). I.e.:
SUM(hrs_studied) / COUNT(hrs_studied) AS agg_avg_study_time
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 days ago.
Improve this question
I was given instagram database with some records and have 7 tables as follows:
Tables--
I am using MYSQL
I have a requirement check the User who have not posted a single photo using sql in MYSQL.
Any help will be appreciated
I tried to get details from Photo table using the query:
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have a date field in my table which is of the type varchar. It's in the format '15-jul-2015'. I want to convert it to date type in sql. The other questions where I looked for an answer didn't have answers to my perticular case. If the answer was there I couldn't find/understand it. I am new to sql and will really appreciate a detailed solution.
Use str_to_date:
SELECT STR_TO_DATE('15-jul-2015','%d-%M-%Y');
see the mysql documentation for more informations.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Would anyone be able to help me with creating a procedure that reports the total amount paid in a specific month and specific year? Or how I would even go about creating this?
Thank you for any and all help.
I'm guessing you have a table that includes both a date column as well as an amount paid column. If that is the case, and you just want to sum the amount paid you can just use the SUM() function.
Try this:
SELECT SUM(totalAmountPaid) as totalForMonth
FROM tableName
WHERE MONTH(dateColumn) = monthYouWant AND YEAR(dateColumn) = yearYouWant
Here are date and time functions that may be useful.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
Here im going to create a database in phpMyadmin.it shows this is not a number error.Here i have attached the image.When im going to save it shows
This is not a number!
You have to enter length for IsActive as it is of type BIT. In Mysql BIT field requires a length to be assigned.
For more details about Data types and their lengths , check out this page
http://www.tutorialspoint.com/mysql/mysql-data-types.htm
http://www.peachpit.com/articles/article.aspx?p=30885&seqNum=7