Hi
I would be grateful for any help.
I need to divide a decimal field by another decimal field. These 2 fields (atick & amin) are set up as VARCHAR fields. I converted both of them as follows:
select cast (atick as decimal(10,9)) / cast(amin as decimal(10,9)) from mytable
BUT getting the...
Hi
I need to select records which were updated previous working day. This means if today is a Monday, I need to select records which were updated on Friday and not yesterday, which will be a Sunday.
I am using WHERE clause to get the previous day, but how can I do a selection whithin a WHERE...
I would be grateful for any help in the following:
1. I need to create additional records (probably using INSERT command) within a SELECT statement depending on a particular condition / situation. I normally use CASE statements within a SELECT statement to handle different conditions. The...
I need to caluculate Monthly (current) and Year-To-Date totals of the same value in the same query.
I am using SUM & GROUPBY commands with WHERE clause, this is working for monthly totals, but to have YTD totals I will need another WHERE clause.
I tried to have another SELECT, which is giving...
Could someone help me with the following:
I need to format numeric values with commas to separate hundreds, thousands, millions etc.
Could someone let me know how to do this please.
Many Thanks
Sivi
I would be grateful for any help in the following:
I need to read a date input from the user in SQL. This date will be used as a parameter in an SQL query.
Please someone could advice me on this.
If this is possible how this could be done.
Many Thanks
Sivi
I would be grateful for any help in the following:
1. I need to create additional records (probably using INSERT command) within a SELECT statement depending on a particular condition / situation. I normally use CASE statements within a SELECT statement to handle different conditions. The...
My query has 5 output fields, combination of 4 of these fields has duplicate entries in the output.
I need to select only the unique combination of these 4 fields.
PLease could someone help me with this, how to select only the unique ones, any help will be grately appreciated.
Many thanks
Sivi
I am trying to divide a decimal number by another decimal number.
I keep getting 'Divide by zero error encountered.' message.
The following is the statement.
The variables 2 & 3 are of varchar types, hence I am trying to convert them to decimal before the calculation.
variable1= case when...
Please could someone help me:
I need to find the last day of any month depending on month stored in the field.
For example the date value stored on the table is:
15032003
I need to find the last day of the month that is '31' for March using the month value '03' in this example. I need this...
I AM TRYING TO CONCATENATE 2 FIELDS, ONE IS HAVING DATA IN IT AND THE OTHER ONE IS 'NULL'. IN THE OUTPUT FIELD I WANT TO REPLACE 'NULL' WITH '0000'.
DATAFIELD 1 = '30001237'
DATAFIELD 2 = 'NULL'
I WANT TO CONCATENATE THE ABOVE 2 AND GET '300012370000'
PLEASE COULD SOMEONE HELP ME WITH THIS...
I am trying to find the lenth of the data field from within a query rather than using the design time literal value of the field length.
a.datafield1+replicate('0',4-len(a.datafield2))+a.datafield2
Here I have used the literal value '4'.
I would be grateful if someone could help me to get...
I am not an experienced in using SQL Server.
I am trying to compare date values, which are stored as varchar on tables, with 1 month back or 1year forward or 2days back from the system date, in different scenarios.
I have tried using DATEDIFF and CONVERT. I keep getting syntax errors.
Please...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.