sona11

sona11

How can I apply a converted date to a SQL Server variable?

How can I apply a modified date and time to a variable? This is what I get when I execute the following query in SQL Server Mgmt Studio:

SELECT CONVERT(varchar(15), CAST(GETDATE() AS TIME), 100) 

I have a variable I need to assign to, such.

DECLARE @mytime AS VARCHAR;

SET @mytime = SELECT CONVERT(varchar(15),CAST(GETDATE() AS TIME),100) --incorrect syntax
SELECT @mytime

Where Next?

Popular General Dev topics Top

Jase
Any opinions on the best platform for dev-friendly blogging?
New
AstonJ
This article got me thinking about encrypted chat: Europol said that French police had discovered some of EncroChat’s servers were lo...
New
New
AstonJ
I really like our #general-developer-forum:in-the-news section and am wondering whether we could automate some of the cross-posting of th...
New
Girtyp
Hi everyone. Getting right to my question, I have recently thought about implementing payment by installment feature in my website. Who k...
New
harwind
I’m working on a web application where users can sign up with their email addresses. To ensure data integrity, I want to implement client...
/js
New
harwind
I’m considering learning new languages to expand my programming skills in 2023. While aware of popular choices, I seek advice on striking...
New
Tazmeen
Hello, I am new to this forum. Not really sure if this topic is relevant for this chat at all. I apologize if its not. I am trying to c...
New
jaeyson
Hi! I received an email from shopperapproved.com, I’ll copy-pasta here: Hi , Would you be willing to help future Manning.com customers...
New
New

Other popular topics Top

Devtalk
Reading something? Working on something? Planning something? Changing jobs even!? If you’re up for sharing, please let us know what you’...
1033 17470 383
New
dasdom
No chair. I have a standing desk. This post was split into a dedicated thread from our thread about chairs :slight_smile:
New
AstonJ
There’s a whole world of custom keycaps out there that I didn’t know existed! Check out all of our Keycaps threads here: https://forum....
New
AstonJ
In case anyone else is wondering why Ruby 3 doesn’t show when you do asdf list-all ruby :man_facepalming: do this first: asdf plugin-upd...
New
AstonJ
If you are experiencing Rails console using 100% CPU on your dev machine, then updating your development and test gems might fix the issu...
New
AstonJ
Continuing the discussion from Thinking about learning Crystal, let’s discuss - I was wondering which languages don’t GC - maybe we can c...
New
Maartz
Hi folks, I don’t know if I saw this here but, here’s a new programming language, called Roc Reminds me a bit of Elm and thus Haskell. ...
New
PragmaticBookshelf
Author Spotlight James Stanier @jstanier James Stanier, author of Effective Remote Work , discusses how to rethink the office as we e...
New
First poster: joeb
The File System Access API with Origin Private File System. WebKit supports new API that makes it possible for web apps to create, open,...
New
PragmaticBookshelf
Develop, deploy, and debug BEAM applications using BEAMOps: a new paradigm that focuses on scalability, fault tolerance, and owning each ...
New