|
From the list
class Delivery { public string ProductCode { get; set; } public DateTime? OrderedDate { get; set; } public DateTime? DeliveryDate { get; set; } public Delivery(string pcode, DateTime? orddate, DateTime? deldate) { ProductCode = pcode; OrderedDate...
Answer Snippets (Read the full thread at stackoverflow):
I don't think DateTime.Now would be useful and now you'd be stuck .
In the case of a null DeliveryDate though you for your DeliveryDate if it's null.
Into a collection of strings indicating when they were delivered .
|
|
#ifndef NULL #define NULL NULL #endif
This code compiles in gcc with no warnings/errors. Can someone explain what the preprocessor is doing here?
Started by sheepsimulator on
, 8 posts
by 8 people.
Answer Snippets (Read the full thread at stackoverflow):
It won't give any error or warning....
Not illegal, just weird :)
doesn't that simply define NULL and type in "NULL" in both the Replace and Replace with fields.
Code for "NULL" and replacing with "NULL".
|
|
I wish to search a database table on a nullable column. Sometimes the value I'm search for is itself NULL. Since Null is equal to nothing, even NULL, saying
where MYCOLUMN=SEARCHVALUE
will fail. Right now I have to resort to
where ((MYCOLUMN=SEARCHVALUE...
Started by James Curran on
, 10 posts
by 9 people.
Answer Snippets (Read the full thread at stackoverflow):
Try WHERE NVL(mycolumn,'NULL') = NVL(searchvalue,'NULL')
Use NVL to replace null with some dummy, but I've occasionally used WHERE ISNULL(MyColumn, -1) = ISNULL(SearchValue, -1)
Replacing "-1=SEARCHVALUE) OR (MYCOLUMN....
|
Ask your Facebook Friends
|
Hi All,
How would you replace nulls with zeros in the output.
FYI .. we should not update the tables, just show zero instead of nulls.
Thanks in advance.
GIGABYTE+
Started by Gigabyte on
, 7 posts
by 3 people.
Answer Snippets (Read the full thread at sqlteam):
SELECT CASE WHEN yourcol IS NULL THEN 0 ELSE yourcol END FROM table
This is exactly what COALESCE does.
|
|
Here's a small example (download, rename to .php and execute it in your shell):
test.txt
Why does preg_replace return NULL instead of the original string?
\x{2192} is the same as HTML " → " ("→").
Started by Ree on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
In your pattern a fault in your Regex expression: ~\x{2192}~u
Try replacing what I have and see if that works out for you.
Will be returned, otherwise subject will be returned unchanged or NULL if an error occurred.
|
|
Hi Everyones,
I would like to remove one null byte in a string, and sometime replace it with another char. Like that :
string = "41 00 36 00 36 00 00 00 57 00 46 00 42 00 41 00 61 00 62 00 73 00 20 00 36 00"
i was thinking about using random and replace...
Started by n00bie on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
>>> pieces[pickone] = 'BA.
You(where0s) >>> pickone 25 >>> # if replacing: ...
Not only that, but 00 isn't "a null" by any stretch of the imagination -- it's a 2-characters string.
|
|
In a mysqli prepared statement, a NULL gets turned into '' (in the case of a string) or 0 (in the case of an integer). I would like to store it as a true NULL. Is there any way of doing this?
Started by ceejayoz on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
//we have no need....
Statement, replacing the "?" markers with "NULL" for every param that has the PHP null valueThe comments to the PHP documentation on mysqli_stmt::bind_param indicate that passing in NULL of $nPos for each ?.
|
|
Hi, I have a query that looks a bit like this:
SELECT weekEnd, MAX(timeMonday) FROM timesheet GROUP BY weekEnd
The valid values for timeMonday are: null, -1, 0, 1-24. At the moment, MAX() places the preference of those values in the order null, -1, 0,...
Started by Jack Sleight on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
FROM timesheet GROUP BY weekEnd) T
replacing NULL by -0.5 when calculating MAX then reverting it to NULLSELECT weekEnd, CASE WHEN maxTimeMonday = -0.5 THEN NULL ELSE maxTimeMonday END maxTimeMonday FROM ( SELECT weekEnd, MAX(CASE....
|
|
If dataitem is Null I want to show 0
<asp:Label ID="Label18" Text='<%# Eval("item") %>' runat="server"></asp:Label>
how can I accomplish this?
Thanks
Started by Muhammad Akhtar on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
If using C#:
public string ProcessMyDataItem....
Try replacing <%# Eval("item") %> with <%# If(Eval("item"), "0 value") %> (or <")) == Null ? 0 : x
You can also create a public method on the page then call that from the code-in-front.
|
|
The clue is in the title but basically I've inherited some code which has 800+ instances of strcpy. I want to write a new function and then to replace strcpy with strcpy_mine.
So I'm trying to work out what parameter list strcpy_mine will have.
I tried...
Started by queBurro on
, 9 posts
by 9 people.
Answer Snippets (Read the full thread at stackoverflow):
One challenge, however of off-topic, but I just want to point out that... .
Shouldn't be very hard to do.
But ensures the result is null-terminated - look at the implementation of OpenBSD's strlcpy that it always null terminates the result.
|