Free Blogger Templates :

facewoman
Ayo berikan dukungan dan semangan anda kepada kami hanya dengan like page Tutor | Blog™ agar tetap terus Maju.
Tampilkan postingan dengan label dates. Tampilkan semua postingan
Tampilkan postingan dengan label dates. Tampilkan semua postingan

Google Spreadsheet Querying and comparing a date with a datetime

Rabu, 10 Oktober 2012 | 0 komentar

Question:

Hi,

I'm using Google Spreadsheets on Chrome on a Windows 7 PC.  My locale is UK.

I have a spreadsheet which is populated from a form.  The first column of the spreadsheet is filled with timestamps, automatically generated when the form is submitted.  They look like this 08/10/2012 16:32:58.
On another sheet of the spreadsheet, I have a query formula, that looks like this:

=QUERY('Form data'!A1:U99,A3,1)

Where column A of 'Form data' contains the datetimes and cell A3 contains:

=CONCATENATE("select A,C,D,E,I,J,K,L,M,N,O,P,Q,R,S,T,U where A >= '",B2,"' and B contains '",LOWER(D2),"@[mydomain].co.uk'")

Where cell B2 contains a date, entered by the user, that looks like this 01/09/2012, and cell D2 contains an email address, entered by the user from a drop down list.

The email address bit works fine. But the date comparison doesn't work. The query function only seems to compare the first part of the entered date, the date of the month, with the first part of the datetime, again, the day of the month. The month and year are both ignored. So if the user enters a date of 01/04/2012, the returned results will be any date where the day of the month is greater than or equal to 1, which is of course every date. So the results are effectively unfiltered. Similarly, if the user enters the date, 29/09/2012, the results will only include lines where the day of the month if greater or equal to 29. So 30/04/2012 would be included, but 01/10/2012 would not.

I have tried several combinations of DATETIME and TIMESTAMP commands, but always get errors. Please will someone much more knowledgeable than me show me what I'm missing?

Thanks

Alec



Solution:


Try this in Cell A3:
=CONCATENATE("select A,C,D,E,I,J,K,L,M,N,O,P,Q,R,S,T,U where todate(A) >= date '",TEXT(B2,"yyyy-MM-dd"),"' and B contains '",LOWER(D2),"@[mydomain].co.uk'")


NOTE: You must format Column A of Sheet 'Form data' as date from "Format" Menu >> "Number" >> "9/26/2008 15:59:00" .

Have a look at the screenshot below:




I hope the above solution will help you, and if you need more help then please do comment below on this blog itself, I will try to help you out.

I also take up private or confidential projects:

If this blog post was helpful to you, and if you think you want to help me too and make my this blog survive then please donate here: http://igoogledrive.blogspot.com/2012/09/donate.html 

Thanks,


Calculating working hours and payable amount per employee per month

Sabtu, 06 Oktober 2012 | 0 komentar

Question:

( by vetobrian )

Please help!! I've created a form in google docs spreadsheets for employees to enter information into a daily time sheet record that is visible to administrative staff only once entered. The names entered into the form will not be fixed (we've got independent contractors across CA) but since the information will be recorded daily the spreadsheet will have multiple entries by any given employee per day for every calendar month. 

What I need to do is the following:

Match entries on "Sheet 4" Column A with the same names in column, total the number of hours & pay that are corresponding in Columns B & C, and re-list in 4 new Columns. All corresponding to each other, one by Name (representing only one name entry per month in new column #1), by dates (dates for one month all included in one cell & new row/cell for another month in new column #2, total hours calculated per month (in new column #3, and total pay calculated per month (in new column #4).

Example:

New Col #1.....New Column #2.....New Column #3.......New Column #4
Tom Hanks......9/2,9/3, 9,10,.......20hrs....................$300
Tom Hanks......8/1, 8/4. 8/30,......40hrs....................$600
Collin Hanks....9/4, 9/6, 9/30,.......100hrs..................$1,000
R.Williams.......6/4, 6/5, 6,15,.......25hrs....................$400
R.Williams.......9/1, 9/15, 9/21,.....80hrs....................$2,500




Solution:


Following is the screenshot of the Sheet named 'Form Response':



Now make a new Sheet 'SolutionSheet' in which you want to display the results:
Here is the screenshot of 'SolutionSheet':



To get the results as shown in the above screenshot, put the following formulas as in Cells mentioned below:

Put the following formula in Cell A2 of SolutionSheet:
=UNIQUE('Form Response'!B2:B)


Put the following formula in Cell B2 of SolutionSheet:
=concatenate(query('Form Response'!B2:C;"select C,', ' where B='" & A2 &"' label ', ' ', ' ";1))



Put the following formula in Cell C2 of SolutionSheet:
=sum(query('Form Response'!B2:I;"select I where B='" & A2 &"'";0))



Put the following formula in Cell D2 of SolutionSheet:
=sum(query('Form Response'!B2:J;"select I*J where B='" & A2 &"' label I*J ''";0))




I hope the above solution will help you, and if you need more help then please do comment below on this blog itself, I will try to help you out.

I also take up private or confidential projects:

If this blog post was helpful to you, and if you think you want to help me too and make my this blog survive then please donate here: http://igoogledrive.blogspot.com/2012/09/donate.html 

Thanks,



 
Support : Free Blog Templates | Free GPRS lt
Copyright © 2012. Tutor | Blog™ - All Rights Reserved
Proudly powered by Free Blog Template
Contact @ FREE GPRS LT