Showing posts with label current. Show all posts
Showing posts with label current. Show all posts

Monday, March 12, 2012

How to capture the only "time" into the database

I've a textbox that displays the current time in this format "hh:mm:ss tt" but when it is save into the database it'll display the date and time together. So how do I save only the time into the database? My codes is as shown below:

txtTime.Text = DateTime.Now.ToLongTimeString()

Dim

parameterDateAs SqlParameter =New SqlParameter("@.Date_5",SqlDbType.DateTime)

parameterDate.Value = txtDate.Text

objCommand.Parameters.Add(parameterDate)

I've tried using Format() but it still get the same results. Can someone help me out? Thanks!

The SQL Datetime datatype will always store a date portion. as effectively all you are doing is storing a time difference since an initial base date/time.

Perhaps change your SQL datatype to varchar and store the time as a string, or else use a constant date along with your time value (IE 1/1/1900).

Dave

Wednesday, March 7, 2012

how to calculate prior period with 52 weeks ?

I defined the calc for prior period for sales amount. But is it possible to get last 52 weeks from the current period?

how to define in this calc?

-- PRIOR PERIOD CALCULATIONS

([Time Calculations].[Prior Period]=

IIF(([Date].[Fiscal Hierarchy].currentmember.lag(1),

[Time Calculations].&[ Current Period])=0,null,

([Date].[Fiscal Hierarchy].currentmember.lag(1),

[Time Calculations].&[ Current Period]))

);

If your hierarchy has a week-level, then I believe what you are looking for is this:

Code Snippet

SET [Time Calculations].[Prior Period] AS 'LastPeriods( 52, [Date].[Fiscal Hierarchy].currentmember )

This gives you a set of the current week and the previous 52 weeks. Assuming [Date].[Fiscal Hierarchy].currentmember is at week-level.

Best regards

- Jens

how to calculate prior period with 52 weeks ?

I defined the calc for prior period for sales amount. But is it possible to get last 52 weeks from the current period?

how to define in this calc?

-- PRIOR PERIOD CALCULATIONS

([Time Calculations].[Prior Period]=

IIF(([Date].[Fiscal Hierarchy].currentmember.lag(1),

[Time Calculations].&[ Current Period])=0,null,

([Date].[Fiscal Hierarchy].currentmember.lag(1),

[Time Calculations].&[ Current Period]))

);

If your hierarchy has a week-level, then I believe what you are looking for is this:

Code Snippet

SET [Time Calculations].[Prior Period] AS 'LastPeriods( 52, [Date].[Fiscal Hierarchy].currentmember )

This gives you a set of the current week and the previous 52 weeks. Assuming [Date].[Fiscal Hierarchy].currentmember is at week-level.

Best regards

- Jens

Friday, February 24, 2012

How to bulk deploy reports to multiple servers?

Hi,

I'm just wondering if there is any easy way to deploy reports to multiple servers. My current issue is that I need to deploy tens of reports onto tens of production server. Does anyone know how to do that?

Thanks a lot.

Cheers,

You can do that by using the command prompt utility and rss files. Look into the following link for more details:

http://msdn2.microsoft.com/en-us/library/ms162839.aspx

Then you can put multiple rs command lines in one single batch file (.bat) and then execute that file for deploying to multiple servers.

Shyam

Sunday, February 19, 2012

How to browse a cube from another project?

Hi, all here,

I have question about how can I browse cube from another project in my current project then?

You can use SQL Server Management Studio to broswe any cube on your server.

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.