Hi,
Why cannot IE parse this string as a Date object.
var d = Date.parse("Fri Jun 11 04:55:12 +0000 2010"); // returns NaN
However, it works well in FireFox. I am running IE 8.
Thanks.
this is what i want. but i have put only a specified date.
SELECT BookName, Author, BookPrice
FROM Book
WHERE Book.Book_ID = (
SELECT Book_ID
FROM Temp_Order
WHERE Temp_Order.User_ID = 25 AND Temp_Order.OrderDate='3/24/2010'
)
this is the date function i used. but it takes the time also. how to stop it. please help me
SELECT Book_ID, BookName,Author,BookPrice
FROM Book INNER JOIN FavCategory ON Book.Category_ID = FavCategory.Category_ID
WHERE FavCategory.User_ID = " + useridlabel.Text + " AND
OrderDate = **GETDATE()**
If I have a table like this:
pkey age
---- ---
1 8
2 5
3 12
4 12
5 22
I can "group by" to get a count of each age.
select age,count(*) n from tbl group by age;
age n
--- -
5 1
8 1
12 2
22 1
What query can I use to group by age ranges?
age n
----- -
1-10 2
11-20 2
20+ 1
So I have a number of namedRanges in an excel worksheet. I would like to use these to fill in comboboxes on a user form in the same WorkBook.
I have tried:
cboMember.DataSource = Globals.Sheet1.MemberRange.Value
No error is given but the combo is blank. Does anybody have any ideas?
I'm trying to use VSTO for VS 2008 on an excel 2003 work book.
Hi, I would like to insert Date value to excel file using Open XML.
Here is my code sample.
cell.CellValue = new CellValue(value.ToString());
cell.DataType = new EnumValue<CellValues>(CellValues.Date);
How can I calculate the number of days from a specific date?in other words add number of days to a date. I looked up NSCalendar and NSdate and could not find anything specific to that regards.
I have the following objects in a collection:
Transaction:
Type = "Widget"
Date = "3/1/2011"
Name = "Foo"
Transaction:
Type = "Widget"
Date = "3/4/2011"
Name = "Bar"
Transaction:
Type = "Gadget"
Date = "3/2/2011"
Name = "Baz"
Transaction:
Type = "Gizmo"
Date = "3/1/2011"
Name = "Who"
Transaction:
Type = "Gizmo"
Date = "3/2/2011"
Name = "What"
Transaction:
Type = "Gizmo"
Date = "3/6/2011"
Name = "When"
I want to end up with the following, grouped by Type. If there are multiple, return only the first one chronologically by date.
Transaction:
Type = "Widget"
Date = "3/1/2011"
Name = "Foo"
Transaction:
Type = "Gadget"
Date = "3/2/2011"
Name = "Baz"
Transaction:
Type = "Gizmo"
Date = "3/1/2011"
Name = "Who"
Trying to format a date string using a technique I've used countless times, suddenly returning false (PHP5). Anyone run into this?
//$new_date = June 14,2010
echo $new_date;
$new_date = date("F j, Y", strtotime($new_date));
//returns the infamous December 31, 1969 because strototime() is returning false?
I have a dataframe with a column of integers that I would like to use as a reference to make a new categorical variable. I want to divide the variable into three groups and set the ranges myself (ie 0-5, 6-10, etc). I tried cut but that divides the variable into groups based on a normal distribution and my data is right skewed. I have also tried to use if/then statements but this outputs a true/false value and I would like to keep my original variable. I am sure that there is a simple way to do this but I cannot seem to figure it out. Any advice on a simple way to do this quickly?
If i'm given a date (say @d = '11-25-2010'), how can I determine the end of the quarter from that date. I'd like to use a timestamp one second before midnight.
I can get this:
select dateadd(qq, datediff(qq, 0, getdate()), 0) as quarterStart
which gives me: '10-1-2010'
and I use this for one second before midnight of a given day:
select DateAdd(second, -1, DateAdd(day, DateDiff(day, 0, @d))+1, 0) ) AS DayEnd
in the end, a quarterEnd method would give me '12-31-2010 23:59:00'
Given two integers X and Y, I want to overwrite bits at position P to P+N.
Example:
int x = 0xAAAA; // 0b1010101010101010
int y = 0x0C30; // 0b0000110000110000
int result = 0xAC3A; // 0b1010110000111010
Does this procedure have a name?
If I have masks, the operation is easy enough:
int mask_x = 0xF00F; // 0b1111000000001111
int mask_y = 0x0FF0; // 0b0000111111110000
int result = (x & mask_x) | (y & mask_y);
What I can't quite figure out is how to write it in a generic way, such as in the following generic C++ function:
template<typename IntType>
IntType OverwriteBits(IntType dst, IntType src, int pos, int len) {
// If:
// dst = 0xAAAA; // 0b1010101010101010
// src = 0x0C30; // 0b0000110000110000
// pos = 4 ^
// len = 8 ^-------
// Then:
// result = 0xAC3A; // 0b1010110000111010
}
The problem is that I cannot figure out how to make the masks properly when all the variables, including the width of the integer, is variable.
Does anyone know how to write the above function properly?
Hello,
I'm building a query with the LINQ dynamic library so I don't know how many potential parameters will I have and I get an error when trying to query DATE type fields:
Operator '=' incompatible with operand types 'DateTime' and 'String'
When I step through the debugger in the Dynamic.cs it shows that the value is of type string and the field is of type date so the problem is obvious but I have no idea how to approach it.
Any ideas?
BR
How to Open a Directory Sorted by Date?
In C#, I can open a directory for reading each file. How to I make sure that the directory I investigate in my C# code is opened such that it is sorted by last modified date?
Well, the following returns what date was 5 days ago:
$days_ago = date('Y-m-d', mktime(0, 0, 0, date("m") , date("d") - 5, date("Y")));
But, how do I find what was 5 days ago from any date, not just today?
For example: What was 5 days prior to 2008-12-02?
I've a table field consists of 10 digits expresses the date and the time.. I want to extract a report where the date/time field can be readable from this field
If i got a new message, in notification expanded view it shows only time. suppose If i got a message today(i.e on 06/06/2010) it should display simply a string "Today" and tomorrow it should show date on whilch message was received i.e it should display date 06/06/2010
Hi, I am unsure how to put this and my math skills aren't that strong. But here's what I need.
I want to generate a list of all the 16bit integers (0-65535). But everytime I do so I want to seed the algorithm randomly that each time the list starts with a different integer and all the subsequent integers will be generated once but also in random order.
small example (1-5): ...
1, 5, 3, 2, 4
4, 3, 1, 5, 2
2, 1, 4, 5, 3 ...
Any help?
Hello all,
Is there an equivalent of MySQLs on update field for SQL server?
With both DEFAULT CURRENT_TIMESTAMP
and ON UPDATE CURRENT_TIMESTAMP
clauses, the column has the current
timestamp for its default value, and
is automatically updated.
What I am looking for is to have a date/time field and every time I update a record it updates the field with the date/time it was updated automatically?
If it doesn't exist, I guess I'll have to go manual.
Thanks all
In my query:
$cselect = mysql_real_escape_string($_POST['cselect']);
---------------
---------------
$sql = sprintf("INSERT INTO content
(id, catID, title, abstract, body, status, published, date, description_meta, keywords_meta)
VALUES ('', '%s', '%s','%s','%s','%s','%s','%s','', '' )", $cselect,$chead, $cabst,$ctext, $cp, $cradio, 'TIMESTAMP: Auto NOW()');
ouptput for date is: 0000-00-00 00:00:00. What is wrong in my query?
Thanks in advance
I currently have a testing environment for web apps on a virtual machine.
The problem - i would like to keep IE 6 for testing and also have access to newer versions of IE as well.
How can i do this?
Thanks.
I think if I just show you the following what I'm asking will make sense.
In a link in my aspx, this works:
' title='<%# Container.DataItem["EventTime"].ToString()
But the above contains the date portion of the string.
This does not work (nor does any variant of it):
' title='<%# Container.DataItem["EventTime"].ToString("hh:mm:ss tt",
CultureInfo.InvariantCulture) %
Evantually, we want the title/hover for the link to read something like "4:30 PM : @Forbes Field"
Everything is working with the exception of the 1/1/1900 being in front of the 4:30
How do I get the date off that EventTime datetime field?