Wednesday, July 20, 2011

How do i convert minutes into hr:mm format in SQL??

some one asked me this question some time back... and again today i came across this question. so i thought of weel documenting it.

How do i convert minutes (probably stored as float in a column in a SQL table....) into hr:mm format??

cast(cast([Time]/60 as int) as varchar) + ':' + CAST(CAST([Time]%60 as int) as varchar) as 'hr:mm'

FROM [dbo].[TableA]

Wednesday, June 29, 2011

Pickle At Work....

Pickle at work!

Its 6 am in the morning and my cell starts ringing. I don’t expect a good surprise at this hour. I got a call from one of my friends.

so i picked up the cell with my fingers crossed, but that didn’t work. With a panic voice, my friend asked me for a drive to hospital as she was suffering from an awful stomach pain.

"it's unbearable, please come soon. take me to an emergency section immediately."

Her house is 10 minutes’ drive from mine. i immediately started for her house with my slipper on; leaving all the morning work to be monitored by my hubby dearest. The outpatient doc immediately asked for few tests, and she was not able to bear the pain, unable to stand up also.

The tests revealed an intestine ailment that has worsened over time, primarily due to negligence. She had to stop by the hospital for 3 days before getting stable to do her tasks independently. with an exhausted list of medications, To Do list, not to Do List, and of course not to mention, a huge bill to be paid, claimed, she was home finally.

Being one of her good friends, i had every right to look at her not-TO Do List. and one of them was not to eat Pickles.

Pickles... it can increase your blood pressure, if taken too much, regularly as a staple part of your daily food, the hot spicy mouth tangling pickle can actually cause ulcers....damaging your intestine.

Hmmm......i warned her in my all possible way to obey and pay due diligence to look at the Not-TO DO List and i headed towards office in my WagonR.

My day was a busy day, with back to back meetings and few of them being very interesting meetings. I categorize few of my meetings as Interesting where there will be lot many exchanges of conversations than in any usual meeting. These are usually review meetings, Root Cause Meetings where all stake holders try to put their view points, trying to prove their

point has big picture implemented compared to others and hence is the ultimate decision to be approved. whereas there would be a audience who oppose and have the all possible historic and pre-historic data ready to ensure that their process is not so easy to approve.

however, in this big puzzle yard, there would be a niche where a very few number of audience exist who just take whatever possible, least bothered about what words are flashing by, as they know they ultimately have to sit and work to implement the decision. they are the ones who actually realize the concept to a product.

They usually not being so assertive, are the ones who take the pinch and overwork, they work hard and harder to meet the deadline and they don’t work smart.

yes.....this is where my thought process paused. i pressed the horn hard as the auto from nowhere came to the front of my vehicle. It’s red signal and he has to wait for green signal to go straight.

 why don’t you understand, i don’t have to wait for the signal. i have to take a left turn, and how can you block the road just like that. why didn’t you keep right before? anyways,

will he listen to all this? can he do anything how much ever i blow the horn? 

it will take another 56 seconds to turn the red signal to green. so that he drives out and i drive left. i thought of continuing my food for thought. Yes, i hate this, when people don’t push back. you are the one who has to sit and work, and if you don’t push back on concepts, flaw points, schedules, deadlines, and you just nod your head, you commit to the stake holders.

your 'Yes' or mum word at this time is automatically making you to commit to the concept, to the design, how much flaw there may be. you are committed to the schedule and more over to the deadline to finish the work. Now, your count down starts. you see there is a flaw in the logic, there is a deadlock in the design and bla bla bla.

but you can’t come out of it now, as you have to finish the same within a certain deadline. come on, every second counts, the first commitment you set up in any private firm is; 'Delivery Excellency', you have to deliver your work on time and with greatest possible quality. so you over work, you forget your food, family, leisure. Day in day out, you work, eat, dream, breadth the flaw logic, how to come out of it. but you don’t know where to start now, even if you report to the stakeholders, it's too late! somehow you make it work and meet dead line, so many issues in live product, quality goes for a toss. now what you get is all 'Pickle', 'pickle' and 'pickle' which has already affected your health in last few days, weeks, months by getting into last monotonous life style of over working, trying to meet the deadline...etc.

so these set of people unnecessarily take all the pickle to themselves.

Why?? ..........

Think over it.

'oh! i can hear someone else blowing horn at me.' 'it's green signal now and that auto driver has already gone away.'

now i drive left and am more relaxed. 'yes! it was a good food for thought today'.

at least i know where and when to push back today! i am determined; i won’t take pickle at work!

Sunday, June 26, 2011

Wow! Windows Easy Transfer!...Wizard

This week end when i was talking to one of my friends, she was very happy and excited as she got a brand new laptop at her work place.
She was excited about the new set up, new hardware features in her latest laptop, features she already explored, and features still need to be explored.
Same time, she was too upset as she had to submit the old laptop soon and she has all her code in her old laptop and that needs to be released in next 10 days. Her thousands of personal files,
beautiful photos to cherish and those favourite music files?

i said anyways you can start transfering files, what's the big deal?
"when i started to trasfer a single folder over network, it took 20 minutes to transfer a 77 mb folder". and i have 45 GB of files and folders to be copied. Phew!!!
Hmm.... first i cursed to her network bandwidth.
then i said, do you know about the Windows easy share feature taht Win 7 has?
i am sorry, i m new to Win 7. ok but it should still be there in your old laptop. even if that is Vista or xp, no worries! it will still work. you can download easily from web.

i said: simply try this out:

1: Open Windows Easy Transfer by clicking the Start button .
2:  In the search box, type Easy Transfer, and then, in the list of results, click Windows Easy Transfer.‌  3: If you're prompted for an administrator password or confirmation, type the password or provide confirmation.
it is a wizard, extremely easy to start. try once, other wise you have any ways another  days to go to bang your head on other possible opportunities. 
she said, ok, let me try this out today, will keep you posted anyways...we disconnected with a punct.
In the evening when i was checking my emails, that reminded me of my dear friend, i called her to check if she had any luck.
After simple greetings, i just asked, so still checking for possible oppotunities?
She replied with a chuckle, "What's the big Deal?...Windows easy Transfer Wizard takes care of all my files and folders..."
and when i smiled, she laughed with a sigh of relief.
and i still wanted to get herself engaged.... "and what about your windows periodic back up??"
Let me have that in another article.

Tuesday, June 21, 2011

So Simple...but i ignored it until i needed it urgently.. access a shared network location using different credentials

When i logged in as a user, andnot as an admin, i figured out that i need some files urgently which is in a network share and i dont have access on the same.

until recently i worked as an admin.... now i am just a user! Oops.... i forgot that i am testing the applciation as a simple user!

how do i access a network share with a different credential in Windows 7 OS machine?

the next best thing i could do was to search in internet, Google, bing.....but surprisingly i dint find the answer so easily.

this is so simple requirement...yet i dont know..... as simple as accessing a network share!, but out of my knowledge store!

after doing some R & D, this is the solution or rather one of the solutions!

1: in Run prompt, type \\server, Right click on the shared folder, then choose "Map Network Drive..."

Check the box that says "Connect using different credentials"

2: click ok and it prompts the user for the credentials to be used for logging in.

3: provide teh same and you are done. in your local machine, access the mapped drive.

Alternative command line:
\\server\public password /user:username /savecred /persistent:yes