date-calculation

Calculating in SQL the first working day of a given month

Hi! I have to calculate all the invoices which have been paid in the first 'N' days of a month. I have two tables . INVOICE: it has the invoice information. The only field which does matter is called 'datePayment' . HOLYDAYS: It is a one column table. Entries at this table are of the form "2009-01-01", 2009-05-01" and so on. I shou...

Easy way to get day number of current quarter?

PHP provides ways to get the number of the current day of the month (date('j')) as well as the number of the current day of the year (date('z')). Is there a way to get the number of the current day of the current quarter? So right now, August 5, it is day 36 of the third quarter. If there is no standard way of calculating this, does an...

jquery datepicker, dates range count

Hello, i am trying to sum up or deduct dates in selected range using jquery datepicker, here is how i am doing it right now but without any luck. function test(){ var sundayCheck = 0; var saturdayCheck = 0; var totalDays = 0; sundayCheck = new Date($("#onlySunday").datepicker("getDate")); saturdayCheck = new Date(...

How to calculate an age based on a birthday?

Possible Duplicate: How do I calculate someones age in C#? I want to write an ASP.NET helper method which returns the age of a person given his or her birthday. I've tried code like this: public static string Age(this HtmlHelper helper, DateTime birthday) { return (DateTime.Now - birthday); //?? } But it's not working....

How can I calculate what date Good Friday falls on given a year?

Does anyone have a good algorithm to calculate what date Good Friday falls on given the year as an input? Preferably in C#. ...

What I have minus months in database (mysql), is it the php code?

Hi, Description: I am doing purchasing function, whenever the users make purchases, it will add 1 month privilege to my access special page of my site. I have received some complaints from my users, please read the problem section. Problem: Out of 500 users, there are few users, that for example: make purchase today, but the expirati...