Hi experts,
I am trying to place an SQL into an unbound field on my form. The SQL is intended to return the maximum date in a field where moduleID = 1. My SQL is as follows:
=(SELECT ...
I've got two queries that I want to combine into one:
SELECT LogDay, Visits FROM vwNumVisitsByDay WHERE LogYear = 2007 AND LogMonth = 2 ORDER BY LogDay
SELECT LogDay, Pages FROM vwNumPages...
i have the following sql statement:
SELECT POL_EFF_DATE FROM POLICY
The POL_EFF_DATE is being returned in a long date format.
Is there any way to configure the above sql statement to ...
I would to use the following example as a sql statement:
SELECT sum(fieldNameX) FROM tablelName WHERE x='1' AND y = '2' ORDER BY fieldNameY LIMIT start, rows
My actual SQL statement is t...
Hi,
I am trying to do a very simple program with a VB.net front end and an Access 2002 back end. I have a list of names and since I am in Ireland many of them have an apostrophe in them. The...
I am trying to add a row number by unique group. In Oracle SQL I could run ROW_NUMBER() OVER (PARITION BY fieldA, fieldB ORDER BY fieldA) to get a counting row number for each unique record i...
Hi all,
I want to use IIF function in the select statement ie:
Seclect field1, iif(field1 = 0, field2, field3) as ResultField, iff(field4 = 0 , 'capital', 'city') as textfield
from atabl...
Hi Experts,
I'm looking for a function to count occurences of a word / substring in a string...
I have seen this - http://sqlblog.com/blogs/adam_machanic/archive/2006/07/12/counting-occurr...
Hi,
I have a table T1 with fields A,B,C,D,E,F
A is a bigint PK created by an identity starting at 1
Some records have identical vaules in C,D,E
In these situations i wish to remove all b...
SQL SELECT * Where dateAdded >= GETDATE() - 1 - how to modify this to Just TODAY?
I have the following query above which returns all records in the last 24 hours. I would like to learn ...
I have a table called Product with a field called ProductCode and one called DiscountType, both varchar.
I have another table called SubProduct which has fields ProductCode and SubProductC...
How do i speed up SELECT JOIN query for 2 large tables? (teststock and prdbesarch)
I've been using this code for a while now and it seems to be working fine.
One table is teststock and l...
Hi,
How come this works:
select 'here comes' + ' joe'
But this gives me an error:
declare @boolValue bit
set @boolValue = 1
IF(@boolValue = 1)
BEGIN
RAISERROR( ('Nooooooo'...
I'm trying to get my table name in a stored procedure be a variable. I've pasted my orginial SP which works fine, but now I have a kink where I need the table name to be access through a varia...
New to this web site. This is pretty sweet. Anyways, I searched solutions without success, thus you are reading my question. Hopefully simple. Is there a way to define a field as autonumbe...
Hi, the date I need to perform a DateAdd on is a string date and needs to be converted. I tried using CAST but recieved an err msg:
Conversion failed when converting datetime from character s...
Hi Guys, I am converting Access SQL to SQL Server and I have two problems:
First of all I cant get the city, state and zip to concatenate. It will not take the "As Location" and it will not...
We've been working on hardening our web site which is written in .asp and uses SQL 2000 on the back-end. We've had a few SQL injection attacks and we're trying to decode what is being passed....
Hi,
I am going to change the order of a tables columns in database 'A' and re-apply the contraints so it is the same as database 'B'.
i get the current order from 'A' with
desc table_...
lst_chnge_dte is a field on db2 table that is defined as decimal & contains date in format yyyymmdd, for instance 20060405
want to update lst_chnge_dte with current date
was going to use
(s...
Can anyone help me in writing a SQL query which takes values from the list box and inserts into a database table.The only complication in this is
The number of items in the listbox may not ...
Hi,
In SQL Server I can write a query which will return all records x amount of days from today date using the code below.
dbo.cart.Creation_Date > GETDATE() - 3
Is the an equivenlt i...
Hi
I want to use an IF statement to check if a SELECT statement returns values. If the SELECT returns values I want to do one thing, and if it does not return any values I want to do anothe...
I am trying to create a UDF. My code is attached.
For each row retrieved by the SELECT statement there will be 2 values.
What is the corret syntax to access both retrieved values? Wh...
Dear EE members,
I have 2 tables A and B.
I need to insert data from A to B.
In A, I have column with the date format as "mm/dd/yyyy".
In B, I have column with the date format as "dd/mm/y...