Showing posts with label date. Show all posts
Showing posts with label date. Show all posts

Wednesday, March 21, 2012

Grabbing DATENAME from date only returns January

why is the below only giving me January?

CAST(DATENAME(Month, datepart(month, ph.systemmonth)) AS varchar(15))

What did you expect ?

-Jens Suessmeyer.

http://www.sqlserver2005.de|||

I solved it:

Results:

0000002 MA 0000002 25 5.00 January 1 2005
0000002 MA 0000002 25 20.00 January 1 2005
0000002 MA 0000002 25 43.00 January 1 2005
0000002 MA 0000002 25 1264.20 January 6 2005
0000002 MA 0000002 25 1344.47 January 6 2005
0000002 MA 0000002 25 210.23 January 10 2005
0000002 MA 0000002 25 211.25 January 10 2005

Expected Results:

0000002 MA 0000002 25 5.00 January 1 2005
0000002 MA 0000002 25 20.00 January 1 2005
0000002 MA 0000002 25 43.00 January 1 2005
0000002 MA 0000002 25 1264.20 June 6 2005
0000002 MA 0000002 25 1344.47 June 6 2005
0000002 MA 0000002 25 210.23 October 10 2005
0000002 MA 0000002 25 211.25 October 10 2005

Resolution:

CAST(DATENAME(Month, '2006/' + Convert(varchar(2), ph.systemmonth)) + '/1') AS varchar(15)) as SystemMonth

for a real date field (which systemmonth was not in this case...since it only contained the month) you can do this:

CAST(DATENAME(Month, '2006/' + Convert(varchar(2), datepart(mm,getdate())) + '/1') AS varchar(15)) as SystemMonth,

Monday, March 19, 2012

Goofy Bullsh!t SQL Server 2005 Date Values

What's with this software? Every day its a new surprise with some goofy
bullsh!t.
I finally make time to try to finish building out ASP.NET 2.0 Membership
logging and reporting code and today its user data in the SQL Server 2005
aspnet_Membership table such as LastLockoutDate and FailedPassword with date
values for all users entered as 1/1/1754.
Not only is this goofy bullsh!t it is grossly incorrect goofy bullsh!t. I
have used one of my three test users to test getting locked out so I could
learn to use the Unlock method and I certainly did not enter that user's
incorrect credentials on 1/1/1754. I have no idea how the other users have
data has been manipulated either.
What the heck is going on here?
<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://www.metromilwaukee.com/clintongallagher/If a Goofy programmer read the goofy doc before posting goofy messages, he
would fined that 1/1/1754 for the lockout data means it has not been locked
out.
http://msdn2.microsoft.com/en-us/library/system.web.security.activedirectorymembershipprovider.aspx
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"clintonG" <csgallagher@.REMOVETHISTEXTmetromilwaukee.com> wrote in message
news:%230DLIENiGHA.1264@.TK2MSFTNGP05.phx.gbl...
> What's with this software? Every day its a new surprise with some goofy
> bullsh!t.
> I finally make time to try to finish building out ASP.NET 2.0 Membership
> logging and reporting code and today its user data in the SQL Server 2005
> aspnet_Membership table such as LastLockoutDate and FailedPassword with
> date values for all users entered as 1/1/1754.
> Not only is this goofy bullsh!t it is grossly incorrect goofy bullsh!t. I
> have used one of my three test users to test getting locked out so I could
> learn to use the Unlock method and I certainly did not enter that user's
> incorrect credentials on 1/1/1754. I have no idea how the other users have
> data has been manipulated either.
> What the heck is going on here?
> <%= Clinton Gallagher
> NET csgallagher AT metromilwaukee.com
> URL http://www.metromilwaukee.com/clintongallagher/
>|||DOH!!!
Sorry, couldn't resist...|||I don't use the AD Provider but I do see by the document you refer to that
the explanation of this goofy date sh!t is much more lucid and complete than
in other documents I did and have read [1] but still happen to have missed
the pithy sentence that is supposed to pass for documentation.
<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://www.metromilwaukee.com/clintongallagher/
[1]
http://msdn2.microsoft.com/en-us/library/system.web.security.membershipuser.lastlockoutdate.aspx
"Roger Wolter[MSFT]" <rwolter@.online.microsoft.com> wrote in message
news:etI$pGOiGHA.4512@.TK2MSFTNGP02.phx.gbl...
> If a Goofy programmer read the goofy doc before posting goofy messages, he
> would fined that 1/1/1754 for the lockout data means it has not been
> locked out.
> http://msdn2.microsoft.com/en-us/library/system.web.security.activedirectorymembershipprovider.aspx
>
> --
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> Use of included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
> "clintonG" <csgallagher@.REMOVETHISTEXTmetromilwaukee.com> wrote in message
> news:%230DLIENiGHA.1264@.TK2MSFTNGP05.phx.gbl...
>> What's with this software? Every day its a new surprise with some goofy
>> bullsh!t.
>> I finally make time to try to finish building out ASP.NET 2.0 Membership
>> logging and reporting code and today its user data in the SQL Server 2005
>> aspnet_Membership table such as LastLockoutDate and FailedPassword with
>> date values for all users entered as 1/1/1754.
>> Not only is this goofy bullsh!t it is grossly incorrect goofy bullsh!t.
>> I have used one of my three test users to test getting locked out so I
>> could learn to use the Unlock method and I certainly did not enter that
>> user's incorrect credentials on 1/1/1754. I have no idea how the other
>> users have data has been manipulated either.
>> What the heck is going on here?
>> <%= Clinton Gallagher
>> NET csgallagher AT metromilwaukee.com
>> URL http://www.metromilwaukee.com/clintongallagher/
>

Goofy Bullsh!t SQL Server 2005 Date Values

What's with this software? Every day its a new surprise with some goofy
bullsh!t.
I finally make time to try to finish building out ASP.NET 2.0 Membership
logging and reporting code and today its user data in the SQL Server 2005
aspnet_Membership table such as LastLockoutDate and FailedPassword with date
values for all users entered as 1/1/1754.
Not only is this goofy bullsh!t it is grossly incorrect goofy bullsh!t. I
have used one of my three test users to test getting locked out so I could
learn to use the Unlock method and I certainly did not enter that user's
incorrect credentials on 1/1/1754. I have no idea how the other users have
data has been manipulated either.
What the heck is going on here?
<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://www.metromilwaukee.com/clintongallagher/If a Goofy programmer read the goofy doc before posting goofy messages, he
would fined that 1/1/1754 for the lockout data means it has not been locked
out.
http://msdn2.microsoft.com/en-us/li...ipprovider.aspx
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"clintonG" < csgallagher@.REMOVETHISTEXTmetromilwaukee
.com> wrote in message
news:%230DLIENiGHA.1264@.TK2MSFTNGP05.phx.gbl...
> What's with this software? Every day its a new surprise with some goofy
> bullsh!t.
> I finally make time to try to finish building out ASP.NET 2.0 Membership
> logging and reporting code and today its user data in the SQL Server 2005
> aspnet_Membership table such as LastLockoutDate and FailedPassword with
> date values for all users entered as 1/1/1754.
> Not only is this goofy bullsh!t it is grossly incorrect goofy bullsh!t. I
> have used one of my three test users to test getting locked out so I could
> learn to use the Unlock method and I certainly did not enter that user's
> incorrect credentials on 1/1/1754. I have no idea how the other users have
> data has been manipulated either.
> What the heck is going on here?
> <%= Clinton Gallagher
> NET csgallagher AT metromilwaukee.com
> URL http://www.metromilwaukee.com/clintongallagher/
>|||DOH!!!
Sorry, couldn't resist...|||I don't use the AD Provider but I do see by the document you refer to that
the explanation of this goofy date sh!t is much more lucid and complete than
in other documents I did and have read [1] but still happen to have miss
ed
the pithy sentence that is supposed to pass for documentation.
<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://www.metromilwaukee.com/clintongallagher/
[1]
http://msdn2.microsoft.com/en-us/li...
ckoutdate.aspx
"Roger Wolter[MSFT]" <rwolter@.online.microsoft.com> wrote in message
news:etI$pGOiGHA.4512@.TK2MSFTNGP02.phx.gbl...
> If a Goofy programmer read the goofy doc before posting goofy messages, he
> would fined that 1/1/1754 for the lockout data means it has not been
> locked out.
> http://msdn2.microsoft.com/en-us/li...ipprovider.aspx
>
> --
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> Use of included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
> "clintonG" < csgallagher@.REMOVETHISTEXTmetromilwaukee
.com> wrote in message
> news:%230DLIENiGHA.1264@.TK2MSFTNGP05.phx.gbl...
>

Sunday, February 26, 2012

GMT date problems

hi,

my web site and sql server are hosted in USA whereas I live in Iceland. When I blog all dates are saved from the USA server's date using the GETDATE() function. Can I change some sql server settings to make it save for my local (icelandic) time?

The best thing you can do s to change the lcid.|||Try this link for some options. Hope this helps.
http://www.karaszi.com/SQLServer/info_datetime.asp

Friday, February 24, 2012

Global setting for business (5 day) versus calendar week

Is there a global setting to specify a business (5 day) versus a calendar (7
day) w for date calculations?> Is there a global setting to specify a business (5 day) versus a calendar
> (7
> day) w for date calculations?|||> Is there a global setting to specify a business (5 day) versus a calendar
> (7
> day) w for date calculations?
Oops - finger slippage. There is no setting, global or otherwise.|||Hi Ledd,
In relation to what though?
You could just check to see if the wday isn't a Saturday or Sunday by
using DATENAME( )
Tony Rogerson
SQL Server MVP
http://sqlserverfaq.com - free video tutorials
"Ledd" <ledd@.discussions.microsoft.com> wrote in message
news:C1885745-46EF-4214-9190-26D8DF72F8DE@.microsoft.com...
> Is there a global setting to specify a business (5 day) versus a calendar
> (7
> day) w for date calculations?|||Thanks. Makes sense.
"Tony Rogerson" wrote:

> Hi Ledd,
> In relation to what though?
> You could just check to see if the wday isn't a Saturday or Sunday by
> using DATENAME( )
> --
> Tony Rogerson
> SQL Server MVP
> http://sqlserverfaq.com - free video tutorials
>
> "Ledd" <ledd@.discussions.microsoft.com> wrote in message
> news:C1885745-46EF-4214-9190-26D8DF72F8DE@.microsoft.com...
>
>|||Create your own Calendar table to identify which days are working days.
Shouldn't be difficult to do calcs against that.
David Portas
SQL Server MVP
--|||How about a calendar table?
http://www.aspfaq.com/2519
"Ledd" <ledd@.discussions.microsoft.com> wrote in message
news:C1885745-46EF-4214-9190-26D8DF72F8DE@.microsoft.com...
> Is there a global setting to specify a business (5 day) versus a calendar
> (7
> day) w for date calculations?

Global Expressions

I'm using Globals.ExecutionTime to display the date of the report.
I would like to only display the year.
Is there somewhere that I can find help with RS Global Expressions? Or any
help would be groovy.
P.S. I'm a NewbHow about:
= year(Globals.ExecutionTime)
If you want anything fancier, then investigate the format function.
Mike G.
"Nice_Out" <NiceOut@.discussions.microsoft.com> wrote in message
news:0719FDB6-6F67-4896-B349-C82E3EEE98A9@.microsoft.com...
> I'm using Globals.ExecutionTime to display the date of the report.
> I would like to only display the year.
> Is there somewhere that I can find help with RS Global Expressions? Or any
> help would be groovy.
> P.S. I'm a Newb

Sunday, February 19, 2012

giving more than one condition in selection formula

hi ,
how to use more than one condion in selection formula.for example
i wish to select the record between two date ranges. i am begnner to crystal repots and also how to use images in crystal report.any body have an idea about this pleaz forward ur answer to meYou will have to create two parameters in your select statement. Since you can not use multiplevalues you will have to do something like the following:

Parameter 1: DateFrom
Parameter 2: DateTo

Your select statment will look something like this:

Select ....
From...
Where table.date >= DateFrom AND table.date <= DateTo|||You can also use Selection Forumla

CR.SelectionFormula="Date between {firstDate} and {SecondDate}"