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

AstonJ
This article got me thinking about encrypted chat: Europol said that French police had discovered some of EncroChat’s servers were lo...
New
DevotionGeo
The version of Java installed with Android Studio on my Mac is the following (when I run java -version) openjdk version "1.8.0_242-relea...
New
brennan
Trying to understand recursion in Elixir. Sometimes it is simple based on the problem, sometimes it is hard. Any suggestions on how to le...
New
New
harwind
Consider the following bits of code: void foo(const int i) // First foo { std::cout << "First " << i << endl; } vo...
New
harwind
I have an array of objects in JavaScript, and I want to sort them based on a specific property of the objects. For example, I have an arr...
/js
New
jaeyson
Is Rust still good to learn? Last time (ages ago) I heard there was changes made by the foundation. If not, is Go suitable for api and w...
New
harwind
I’m working on a SQL query for a database containing records of customer transactions. Each transaction has a transaction_id, customer_id...
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
GTX
Hello everyone! I am not a developer, just wanna know if it’s possible for someone with no skills to learn how to reverse hack my hackers.
New

Other popular topics Top

AstonJ
A thread that every forum needs! Simply post a link to a track on YouTube (or SoundCloud or Vimeo amongst others!) on a separate line an...
New
AstonJ
What chair do you have while working… and why? Is there a ‘best’ type of chair or working position for developers?
New
DevotionGeo
I know that -t flag is used along with -i flag for getting an interactive shell. But I cannot digest what the man page for docker run com...
New
AstonJ
I have seen the keycaps I want - they are due for a group-buy this week but won’t be delivered until October next year!!! :rofl: The Ser...
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
Seems like a lot of people caught it - just wondered whether any of you did? As far as I know I didn’t, but it wouldn’t surprise me if I...
New
mafinar
Crystal recently reached version 1. I had been following it for awhile but never got to really learn it. Most languages I picked up out o...
New
wmnnd
Here’s the story how one of the world’s first production deployments of LiveView came to be - and how trying to improve it almost caused ...
New
foxtrottwist
A few weeks ago I started using Warp a terminal written in rust. Though in it’s current state of development there are a few caveats (tab...
New
PragmaticBookshelf
Rails 7 completely redefines what it means to produce fantastic user experiences and provides a way to achieve all the benefits of single...
New