How to code SQL statements from generated Crystal [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 8 years ago.
Improve this question
Here we have generated Crystal SQL and I need to make these same on AS/400 db2 for performance reasons. How do you code these in AS/400 SQL?
TodaysDate
like and
<>

select ...
from order_table
where order_date = current date and
status_code in ('E', '1', 'X') and
user = 'BLOGGS';
The DB2 for i Reference manual may be helpful.

Related

SQL Query to get date [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 months ago.
Improve this question
How can I change this for TODAY? I'm making #Hist_date as date however it needs to be for today.
I have tried GETDATE abd I think I'm coding it wrong
(#HIST_DATE DATE)
use select.
declare #HIST_DATE date
select #HIST_DATE = GETDATE()

How to perform an SQL update using TADOCommand? [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 want to create an update button using TADOCommand which is on a TDataModule, but this code doesn't work. Does anyone know what the correct code is?
Your SQL is malformed, as you are missing commas between the fields:
UPDATE Elektronik SET Nama_Barang = :Nama_Barang, Harga = :Harga, Stok = :Stok WHERE ID = :ID

SQL Server 2008 Replace substring [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 8 years ago.
Improve this question
I have a Screen table which has name and display_name columns. I am trying to replace the word Lawfirm with Law Firm in name and display_name columns for all the records of Screen table.
My SQL experience is pretty premature, I am wondering is there a way to achieve this using a SQL script?
Yes, you can do this:
update screen
set display_name = replace(display_name, 'Lawfirm', 'Law Firm')
where display_name like '%Lawfirm%';

How can make auto change 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 8 years ago.
Improve this question
I want to make auto changes in SQL Server. I have a table which has a column [expires date]. Should I use a trigger or job for this? I want that SQL Server checks those dates every day, and if any of it is < DateTime.Now, it must change a column [IsPremium] of that row.
Add the following statement in your Daily running JOB, if you have. (Your question in unclear. As per my understanding I post this)
UPDATE <tablename> SET
IsPremium = 1
WHERE [expires date] < GETDATE()

Need to replace a part of a value in Sql Server 2005 [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 8 years ago.
Improve this question
My table name is SOFTSKILL. One of Columns is MakeID. The values in the column are,
000277755
000278143
000277738
000277051
i need to change 000 into 100, like
100277755
100278143
100277738
100277051
Anybody please help me how to do this..
UPDATE SOFTSKILL
SET MakeId = STUFF(MakeId,1,1,'1')
WHERE MakeId LIKE '000%'