2,569 Topics

Member Avatar for
Member Avatar for axman1000

I would like to retrieve the previous date (i.e., current date minus 1) and use it in a query through an = operator. I got the following query to retrieve the previous date: [icode]select DATEADD(DD, DATEDIFF(DY, 0, GETDATE()), -1)[/icode] It gives: 2011-03-14 00:00:00.000 I would like to get only: 2011-03-14, …

Member Avatar for axman1000
0
226
Member Avatar for BenWard

Hello, I'm having some trouble with SQL CE. The below code *should* insert a record into the 'maps' table. (table adapters all set up) sometimes it says cannot insert as breaching primary key constraint, which is fine, but it otherwise fails with cannot insert NULL into iMapId. I have checked …

Member Avatar for BenWard
0
127
Member Avatar for agr8lemon

Hello everyone! I'm trying to get a date from SQL without the year. Every code I've seen has included the year. Here is what I have now. [CODE]SELECT * , convert(CHAR, \"date\", 10) AS ndate from dbo.MYDB where 35 > DATEDIFF(d,\"date\", GETDATE())";[/CODE] I would like ndate to be show like …

Member Avatar for agr8lemon
0
144
Member Avatar for axman1000

I have an SQL Server Query: select *from table1 where column in ('list of values') When I execute this, I get all the details, however, when I do this: select *from table1 where column in ('list of values') and date_of_req='2011-03-15' I get an empty table. All the column headings are …

Member Avatar for axman1000
0
178
Member Avatar for erum

i m facing problem while conencting with sql server mangemnet studio A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. …

Member Avatar for hchf
0
228
Member Avatar for axman1000

I will get an Excel 2003 file everyday via email. This file has 5 columns. The first for columns have static headers and text in them. The 5th column is the date of the report and below that is a list of values in the same column, followed by an …

Member Avatar for axman1000
0
209
Member Avatar for Mike Bishop

Afternoon All, hope someone can help as this is really doing my head in. I have a SQL View which has a field called MOP/T which shows the number like so 28.5140299679490 349.893390000000 349.893389892905 I want to format that field so that it only shows the number before the decimal …

Member Avatar for Mike Bishop
0
104
Member Avatar for lewilaloupe

Hi, This is a SQL statement query (so may be in the wrong forum). Any help much appreciated! I have 3 tables in an Access DB (I know!): IndexData is main table with title, description, date, fileid Category table has categories (Cat1) associated to fileid in IndexData i.e. a fileid …

Member Avatar for reygcalantaol
0
185
Member Avatar for paresh_thummar

Hi I want to store query result in single variable like if query is "select count(*) from tablename" , and it return suppose 21 records (integer value) then I want to save this value in my database during insertion of record what should i write in place of question mark …

Member Avatar for Akash Saikia
0
1K
Member Avatar for Nony2007

Hi All, I can connect C# to SQL and read SQL table but i am having problem in writing the outcome to text file. I really appreciate if you could assist me. this is the code. [CODE]//====================================== using System; using System.Data; using System.Data.SqlClient; using System.IO; namespace Chapter07 { class OrdinalIndexer …

Member Avatar for Nony2007
0
1K
Member Avatar for JeanPhilippe

Hi, i'm trying to get something to work. I want to do a query with multiples "if not" conditions in a mysql query. This is working : SELECT * FROM table WHERE column!='value' This is not working : SELECT * FROM table WHERE column!='value' OR column2!='value' I've tried all kind …

Member Avatar for ifezuec
0
117
Member Avatar for prem2

Dear all, I have using db operations such as insert,update,select,delete in my program .I have perform this operation using the prepared statement. How to avoid the sql injection in my java program.? *)I want to know functions to avoid the escape characters in java ? *)Did any one know what …

Member Avatar for Taywin
0
1K
Member Avatar for ChrisHunter

Hi i keep getting an exception when i'm trying to update table values within a database. the exception is below but i dont change from datetime to varchar it always stay as datetime. is there any other reasons why this is happening ? "The conversion of a varchar data type …

Member Avatar for ChrisHunter
0
179
Member Avatar for ShaggyDogg

Hi, Not sure if my question belongs in an ASP.NET or MSSQL forum.. I have an ASP.NET webpage built in VS2010 with an Input field with the functionality to browse to a network directory, select a text file, read content and upload the data to an MSSQL database table. Nothing …

Member Avatar for ShaggyDogg
0
787
Member Avatar for thejman82

I would like some help on this database design I need to have completed by next week. Here's the specs: I'm creating a custom PC builder application. I've been getting stuck on trying to create the database for it. I would like to be able to enter customer details then …

Member Avatar for debasisdas
0
219
Member Avatar for raaboo

Hi, I am trying to generate an sql query to insert several pieces of data, most of which comes from another table, however I have one variable that comes from PHP variables as below: [CODE]insert into scores (AuditID, question_id, available_score, question, question_number, question_section) values ($auditvalue, (SELECT questions.quid, questions.question_value, questions.question, questions.question_number, …

Member Avatar for diafol
0
184
Member Avatar for Coyx

Hi everyone, I'm in a spot of bother. Attached is an image which should help better show what I'm about to ask for assistance with. :) [url]http://img96.imageshack.us/img96/7624/sqlm.jpg[/url] What I have, is 2 tables that associate each other with 'packholder' In the table shown, you can see Packholder - 1, 2, …

Member Avatar for Coyx
0
200
Member Avatar for xreyuk

Hi All, I'm a fairly new programmer so you'll have to bear with me on this. Basically, I have a database with 3 tables, Engineers, Equipment and Signouts. I want to create a VB application that allows engineers to sign out equipment. I have all of the forms setup the …

Member Avatar for Pgmer
0
336
Member Avatar for liran

Hye I have a question: Suppose I use JDBC, JDBCTemplate in order to execute a sql query. The query is something like: query = "SELECT ... FROM ... WHERE user = ? AND password = ? AND x='valuex' AND y='valuey' ..." Where user,password - I got from the web user …

Member Avatar for liran
0
300
Member Avatar for Blaine Tuisee

I have two tables representing two forms that are connected each other but a form number. The second form records a number and a timestamp. This form can record multiple entries with a timestamp for each entry. I need a SQL statement that will return the first entry on Form2 …

Member Avatar for smantscheff
0
171
Member Avatar for aplee

Hi everyone, I am getting this error: [CODE]Msg 512, Level 16, State 1, Line 1 Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression. The statement has been terminated.[/CODE]please …

Member Avatar for buddylee17
0
169
Member Avatar for judithSampathwa

hi i have a question in getting values from two table i ave two tables Table1 and Table2. table 1 have data and table 2 may have the same data as table 1 and more. and also table 1 may have the same data and some which is not in …

Member Avatar for buddylee17
0
121
Member Avatar for v5rox

i m trying to update a table in my sql database using stored procedure. i have executed my stored procedure and dat works fine, no problem in that. i knwo because the values are updated when i execute it. however when i try to do so through asp.net code that …

0
105
Member Avatar for deolalkar_pooja

Hi to all, I create the following table. create table man(id integer, name varchar(20), city varchar(20), age integer) I want the age, maximum age of person. So, I ran following query, select name, max(age) from man group by name; It shows name of all person in ascending order with their …

Member Avatar for jbisono
0
87
Member Avatar for MARKAND911

I have a table in which i have a column named "dtCreated" which has got datatype as VARCHAR(50) Now I want records between two dates. I wrote my query as written below [CODE] select * from mytable where dtcreated>=fromdate and dtcreated<=todate [/CODE] This query work fine when fromdate and ToDate …

Member Avatar for Akash Saikia
-1
195
Member Avatar for deolalkar_pooja

Hi to all, I have nothing idea about how to create relation and solve their queries. I want to relation as follows: ------------------------------------------------------------------- BookAuthor(book, author, earnings) BookReference(book, referenceBook, times) BookReview(book, reviewer, score) BookPublih(book, year, publisher, price, numbar) In these database, each book may have 1 or more authors & each …

0
73
Member Avatar for deolalkar_pooja

Hi to all, I created the following two table -------------------------------------- create table mail(mid integer primary key, name varchar(20) ) create table phone( pid integer foreign key references mail(email), phone integer) ----------------------------------------- After inserting records on both table, now i want delete perticular record from table say 'delete record of pid=12'. …

Member Avatar for Momerath
0
145
Member Avatar for lostinwindows

I have a Windows SBS 2008 system. Occasionally, When I look at the daily report it shows that status of updates as unavailable. The status may be fine for up to 2 weeks or I may get this message every day for 4 or 5 then it disappears for a …

Member Avatar for lostinwindows
0
155
Member Avatar for Joseph Schrag

I have an existing database design which I would like to normalize. Essentially, the table causing me problems is one with about 150 columns. The table holds live data for a natural gas well. So, there are columns for the various temperatures, pressures, etc. The data types of these columns …

Member Avatar for Joseph Schrag
0
163
Member Avatar for tcollins412

i am using the following code to submit a form: [CODE] <script> function marktaskcomplete(){ document.forms["markcomplete"].submit(); } </script> <? if ($_POST['markcompletevalue']=='yes'){ include "dbconnect.php"; $taskid=$_POST['taskid']; $query="UPDATE tasks SET status='0' WHERE uid='$id' AND id='$taskid'"; $result=mysql_query($query); if ($result){ echo "<script>location.href='?goto=taskmanager'</script>"; }else{ echo"fail"; } mysql_close; } ?> [/CODE] and when i try to submit more …

Member Avatar for tcollins412
0
241

The End.