Showing posts with label timestamp. Show all posts
Showing posts with label timestamp. Show all posts

Thursday, March 22, 2012

Date parameters with annoying and unwanted Timestamp.

I have two date parameters which will be used as data range in my
report.
But when I enter same date in both date parameter text boxes it appends
the timestamp (12:00:00 AM).
Example: When I enter 07/24/2004 and 07/24/2004 it converts that into
07/24/2004 12:00:00 AM and 07/24/2004 12:00:00 AM.
If I'm generating a report with those parameters I shouldn't get any
data back if I can't take care of that datetime in my stored proc. But
for how many end users do I need to explain and ask them for not to
worry about it when it shows in the front end?
Isn't it really annoying?
Is there anyway to get rid of 12:00:00 AM?The only way is to change the report parameter from date to string.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"RK" <am_i_dotnet@.hotmail.com> wrote in message
news:1122317815.803912.144810@.o13g2000cwo.googlegroups.com...
>I have two date parameters which will be used as data range in my
> report.
> But when I enter same date in both date parameter text boxes it appends
> the timestamp (12:00:00 AM).
> Example: When I enter 07/24/2004 and 07/24/2004 it converts that into
> 07/24/2004 12:00:00 AM and 07/24/2004 12:00:00 AM.
> If I'm generating a report with those parameters I shouldn't get any
> data back if I can't take care of that datetime in my stored proc. But
> for how many end users do I need to explain and ask them for not to
> worry about it when it shows in the front end?
> Isn't it really annoying?
> Is there anyway to get rid of 12:00:00 AM?
>

Sunday, March 11, 2012

Date Formatting

I know this has probably been beaten to death, but I still have not found a
way to use datetime in a matrix. I have a timestamp field with the value of
datetime.
I want to group by the date, not using the time. When I format the date, it
still groups by the datetime, not the date only. I also tried to
concatenate the date parts, but 11/10 comes right after 11/1.
Any ideas?
Thanks.You can always use function calls to generate numbers from the DateTime
value. For instance, you can use this function for the grouping (and achieve
correct date ordering):
=Year(Fields!Date.Value) * 10000 + Month(Fields!Date.Value) * 100 +
Day(Fields!Date.Value)
MSDN references:
* http://msdn.microsoft.com/library/en-us/vblr7/html/vafctday.asp
* http://msdn.microsoft.com/library/en-us/vblr7/html/vafctmonth.asp
* http://msdn.microsoft.com/library/en-us/vblr7/html/vafctyear.asp
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"John Geddes" <john_g@.alamode.com> wrote in message
news:e2OV1FV4EHA.2568@.TK2MSFTNGP11.phx.gbl...
> I know this has probably been beaten to death, but I still have not found
a
> way to use datetime in a matrix. I have a timestamp field with the value
of
> datetime.
> I want to group by the date, not using the time. When I format the date,
it
> still groups by the datetime, not the date only. I also tried to
> concatenate the date parts, but 11/10 comes right after 11/1.
> Any ideas?
> Thanks.
>|||That worked pefectly. thanks!!!!
"Robert Bruckner [MSFT]" <robruc@.online.microsoft.com> wrote in message
news:OwI$$MV4EHA.3388@.TK2MSFTNGP15.phx.gbl...
> You can always use function calls to generate numbers from the DateTime
> value. For instance, you can use this function for the grouping (and
achieve
> correct date ordering):
> =Year(Fields!Date.Value) * 10000 + Month(Fields!Date.Value) * 100 +
> Day(Fields!Date.Value)
> MSDN references:
> * http://msdn.microsoft.com/library/en-us/vblr7/html/vafctday.asp
> * http://msdn.microsoft.com/library/en-us/vblr7/html/vafctmonth.asp
> * http://msdn.microsoft.com/library/en-us/vblr7/html/vafctyear.asp
> --
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
> "John Geddes" <john_g@.alamode.com> wrote in message
> news:e2OV1FV4EHA.2568@.TK2MSFTNGP11.phx.gbl...
> > I know this has probably been beaten to death, but I still have not
found
> a
> > way to use datetime in a matrix. I have a timestamp field with the
value
> of
> > datetime.
> >
> > I want to group by the date, not using the time. When I format the
date,
> it
> > still groups by the datetime, not the date only. I also tried to
> > concatenate the date parts, but 11/10 comes right after 11/1.
> >
> > Any ideas?
> >
> > Thanks.
> >
> >
>

Tuesday, February 14, 2012

Date and time

Hello all!
I want to create a time stamp based on the system date and system
time. The format of my timestamp should be YYYYMMDDhhmmss.
YYYY year
MM month
DD day
hh hours
mm minutes
ss seconds
Does anyone have a clue on how can I do this?
Thanks in advance,
Hugo MadureiraHere's an example:
DECLARE @.i datetime
SET @.i = CURRENT_TIMESTAMP
SELECT CONVERT(varchar(8), @.i, 112) + REPLACE(CONVERT(varchar(8), @.i, 108),
':', SPACE(0))
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Hugo Madureira" <hugomadureira@.hotmail.com> wrote in message
news:uhptUrejFHA.2644@.TK2MSFTNGP09.phx.gbl...
Hello all!
I want to create a time stamp based on the system date and system
time. The format of my timestamp should be YYYYMMDDhhmmss.
YYYY year
MM month
DD day
hh hours
mm minutes
ss seconds
Does anyone have a clue on how can I do this?
Thanks in advance,
Hugo Madureira|||Thanks a lot, it worked. That would have take me days to find that out.
Narayana Vyas Kondreddi wrote:
> Here's an example:
> DECLARE @.i datetime
> SET @.i = CURRENT_TIMESTAMP
> SELECT CONVERT(varchar(8), @.i, 112) + REPLACE(CONVERT(varchar(8), @.i, 108)
,
> ':', SPACE(0))
>|||Hi
If you use the normal datetime datatype and getdate() to populate a default.
This can then be displayed in whatever format is require on the client. If
really necessary you can use
REPLACE(REPLACE(REPLACE(CONVERT(char(19)
,mydate,120),'-'.''),SPACE(1),''),':
','') to get YYYYMMDDHHMISS format.
John
"Hugo Madureira" wrote:

> Hello all!
> I want to create a time stamp based on the system date and system
> time. The format of my timestamp should be YYYYMMDDhhmmss.
> YYYY year
> MM month
> DD day
> hh hours
> mm minutes
> ss seconds
> Does anyone have a clue on how can I do this?
> Thanks in advance,
> Hugo Madureira
>