In Access 2007, I'm trying to use the NTlogin to retrieve a value from a table via a SQL query (see code below). WHen the form loads, I get an error message saying "Compile Error: Expected Function or Variable". Can someone tell me how to fix this error.
Private Sub Form_Load()
Dim UserName As String
Dim strSQL As String
D...
How can I retrieve the fields within an XML field in MS SQL?
Every query I try does not work as intended whenever I use this XML code:
I want to select the AccNumber value.
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSch...
Suppose I have a date 2010-07-29. Now I would like to check the result of one day ahead. how to do that
For example,
SELECT *
from table
where date = date("2010-07-29")
How to do one day before without changing the string "2010-07-29"?
I searched and get some suggestion from web and I tried
SELECT *
from table
where date...
I have the follwoing query which works but I'm wondering if it could be more efficient. I need the first and last name of the 4 employees from the phonebook table (pb) who's badges (the employees ID) are stored in the Commitment table
SELECT Originator_ID,
(SELECT pb.lname FROM pb WHERE pb.badge = Commitment.Originator_ID) AS Origina...
I have the following table:
Id INT/PK
UserId INT/FK
CreatedDate DATETIME
ActivityMarker INT/FK
The table can be written to (incl. record updates) and deleted from (e.g. today I can delete a record from 1/1/2010). The CreatedDate contains the date the record was created. ActivityMarker and UserId can be updated.
What I need to do is k...
Given a table with a timestamp on each row, how would you format the query to fit into this specific json object format.
I am trying to organize a json object into years / months.
json to base the query off:
{
"2009":["August","July","September"],
"2010":["January", "February", "October"]
}
Here is the query I have so far -
SE...
I am little bit stuck with the following problem. I have two models:
class Book < ActiveRecord:Base
has_and_belongs_to_many :tags
end
class Tag < ActiveRecord:Base
has_and_belongs_to_many :books
end
I have a list of specific tags that can but must not be used in the tags table:
tag1, tag2, tag3, tag4, tag5, ...
Each new boo...
I want to execute a query of the form:
INSERT INTO table(field1, field2) SELECT field1, field2 FROM table WHERE id IN ( 4, 8, 15, 16, 23, 42 )
Where id is the auto_increment'ing primary key of table.
After executing this statement, I want to know what all the new id's that just got generated are. How can I recover this information? I'...
Let me explain what I mean with that question:
Lets say I have to tables like these:
customers
id customer location
1 Adam UK
2 Pete US
values
id value
1 10
1 7
2 3
2 41
Let's ignore here for a moment that that (and the following query) wouldn't make a lot of sense. It's meant as a simplified example.
Now, if ...
I have a column of numbers in a MySQL database, along with a timestamp column and other stuff. I want to know the average of all of the values within a set parameter (say, within the last week), and I also want the average of all of the values that are >= X during that same timeframe. So, if my X is 10, and my values are:
0 0 10 15 20, t...
Hi,
I came into problem that I need to display the top 3 records for each aId in a comma separated string in one column (for eg. aId=151 ghghg,ghh, rgtg
) instead of the below result. Can anyone help me please?
Expertise
ghghg
ghh
rgtg
rtrt
ghgh
tyuyu
fgfg
yuu
dfdf
gtyy
dfdf
df
ssd
dfd
dfdf
fd
dfdf
d...
I want to create my site and in the page have it so that the forum pages will use the forum mysql user having privileges on mydb.forum_table, mydb_forum_table2.
and the profile page to use the profile user having access to mydb.users and mydb.profiefields
and so on with the photogallery, blog, chat and...
is this the right way to do it!...
I'd like to utilize Select & Insert statements on a DataTable in VB.NET or C#.
Example:
Dim Results as DataTable
Results = Select * from SourceDataTable where PlayerID < 10
Is anything similar to this possible?
Thanks
...
I'd like to do something like the following:
Dim Conn as new SqlConnection(ConnectionString)
MyDataTable.WriteToDB(Conn, "New Table")
Are there any shortcuts like this built into .NET?
Thanks
...
I am trying to create a report that has some data values. Each data value can be of a 'good' or 'bad' quality. I would like to pass a value color through the dataset using a custom C# data provider object.
Once in the report designer, I can use 'Fields!MyColumn.Value' and it works fine. There is also an option to type 'Fields!MyColumn.C...
The act of transforming procedural code into SQL has been of interest to me lately. I know that not absolutely everything is expressable in a turing complete procedural language.
What if you have a special purpose procedural language though? For instance converting something like this:
foreach(var row in Table){
if(row.FirstName=="F...
Hello ALL,
I have following table structure
table_country ==> country_id (PK) | country | status
table_department ==> department_id (PK) | department | country_id (FK)
table_province ==> province_id (PK) | province | department_id (FK)
table_district ==> district_id (PK) | district | province_id (FK)
NOTE: all tables engine are inn...
SqlConnection con = new SqlConnection(str);
int ID;
ID = Int32.Parse(Combo_Stu.SelectedValue.ToString());
double a = double.Parse(Txt_Ins.Text);
string date = dtp_Stu.Value.ToString();
SqlCommand sqlcmd1 = new SqlCommand("INSERT INTO Instalment_Billing(ID,Pay_Date, Fees) VALUES (" + ID + "," + **date** + "," + a + ")", con);
con.Open();
...
Hi,
I'm sure this has been asked but I can't quite find the right search terms.
Given a schema like this:
| CarMakeID | CarMake
------------------------
| 1 | SuperCars
| 2 | MehCars
| CarMakeID | CarModelID | CarModel
-----------------------------------------
| 1 | 1 | Zoom
| 2 | 1 ...
how to get the data from select Query whete column having null value.
...