update sql query in new column [closed] - sql

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I have a column in which i have 'goswara no. 21/1980' i need only 21 and year from date column like this col gr=21/year(date) through sql2005 query

http://sqlfiddle.com/#!6/bf991/6
something like this?
select
right(columnname,4) as year ,
SUBSTRING ( columnname ,len(columnname) - 6 ,2 ) as result
from test

Related

Converting Decimal hours to minutes in SQL Server? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
I have a decimal hour (logged_hours) column and its value in my table. I want to calculate this decimal hour value into minutes in SQL Server 2012.
logged_hours
------------
08.0000
09.0000
12.0000
You can multiply by 60:
select logged_hours * 60 as logged_minutes

Sql query to concatenate 2-3 columns one column is a number and another column is date datatypeusing Ms access [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
Ex: if we concatenate 12345 and 31-dec-2019 If we concatenate using & symbol we get 1234531-dec-19 in Ms access but if we do same in excel we get 1234543830 so to get the result as we get in excel what is the query to get this.
You can use the CLng function to convert the date field to a number:
SELECT NumberField, DateField,
[NumberField] & CLng([DateField]) AS CombinedData
FROM Table4;

Convert String Date to Unix TimeStamp Sqlite3 [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I've to copy a column in another column, but the result is that only the first row is copied and put in all the rows of the other column
I'm trying to execute this query:
UPDATE gdf_storico Set Data = (SELECT Giorno FROM timestamp)
But that stores the same date in all columns
In SQLite, you can use strftime() with modifier '%s' to convert a date to an epoch timestamp:
select datecol, strftime('%s', datecol) as unix_ts
from mytable

How to format money value in SQL [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
Where is the problem with my sql command?
select REPLACE(CONVERT(varchar, CAST(price AS money), 1),'.','.') as price
output :
price
-----
145,000,00
I want output like this
price
-----
145.000,00
Formatting results is usually best left for the front end.
Having said that, with SQL Server 2016, use the format function with an appropriate locale:
declare #m money = 145000
select format (#m, '#,###.00', 'DE-de')

Select without negative values in SQL query [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
How to select needed values without negative Total values according to this query?
Second row should not be returned as the Total value is less than 0.
SELECT DealerCode, PaymentType, Total
FROM DEL_Purchases
WHERE DealerCode = 'A0686P'
select DealerCode, PaymentType, Total from DEL_Purchases
where DealerCode='A0686P' and Total > 0