o
k
q
u
e
s
t
i
o
n
s
.
c
o
m

Help with SQL statements -

What I need (and forget how to do) is:

create a cmd(button) on a form that when I click it will access a database and extract appt-times based on time ending in #1. I have it working in access but I forget how to do it in VB (setting up connection, extract based on SQL and viewing records.

Here is my Access SQL statement

SELECT Format([APPT-TIME],"Long Time") AS Timetxt, Monday.[CUSTOMER NAME], Monday.YR, Monday.MODEL, Monday.VEHID, Monday.ESTDUR
FROM Monday
WHERE (((Format([APPT-TIME],"Long Time"))=#12/30/1899 7:31:0# Or (Format([APPT-TIME],"Long Time"))=#12/30/1899 8:1:0# Or (Format([APPT-TIME],"Long Time"))=#12/30/1899 8:31:0# Or (Format([APPT-TIME],"Long Time"))=#12/30/1899 9:1:0# Or (Format([APPT-TIME],"Long Time"))=#12/30/1899 9:31:0# Or (Format([APPT-TIME],"Long Time"))=#12/30/1899 10:1:0# Or (Format([APPT-TIME],"Long Time"))=#12/30/1899 10:31:0# Or (Format([APPT-TIME],"Long Time"))=#12/30/1899 11:1:0# Or (Format([APPT-TIME],"Long Time"))=#12/30/1899 11:31:0# Or (Format([APPT-TIME],"Long Time"))=#12/30/1899 12:1:0# Or (Format([APPT-TIME],"Long Time"))=#12/30/1899 12:31:0# Or (Format([APPT-TIME],"Long Time"))=#12/30/1899 13:1:0# Or (Format([APPT-TIME],"Long Time"))=#12/30/1899 13:31:0# Or (Format([APPT-TIME],"Long Time"))=#12/30/1899 14:1:0# Or (Format([APPT-TIME],"Long Time"))=#12/30/1899 14:31:0# Or (Format([APPT-TIME],"Long Time"))=#12/30/1899 15:1:0# Or (Format([APPT-TIME],"Long Time"))=#12/30/1899 15:31:0# Or (Format([APPT-TIME],"Long Time"))=#12/30/1899 16:1:0# Or (Format([APPT-TIME],"Long Time"))=#12/30/1899 16:31:0#));

Sorry for the mess,

can someone HELP please

 

if... an if statement -
Is there any possible way to if a set of if statements so if the inside if statements return true then execute the outside if statements code? A lot of if in that line.


I FIXED IT!! -- Read On -
I feel as if I should post this in the c++ section cause it is very c++ related...see about half-way through the few functions I Wrote to init parts of Dx, it would be at Init_DInput function I wrote. Now I had an if statement for if the progammer wants mouse or keyboard or both ini


Stored Procedure - SQL Server 7 -
Hi all, Over the weekend I tried to write a stored procedure that included Select... Into, Alter Table, and Update statements. I tried adding GO after each statement and that worked fine in the query analyzer. I tried copy and pasting the statements into the stored procedure and


select case with non integer numbers -
Hello I have got a select case structure with non integer values, it goes like this select case power case 0.001 'statements case 1 'statements case 2 'statements case 20.001 'statements case 40 'statements case 40.001 'statements case 60 'statements


Replacing IF statements -
Instead of having a bunch of IF statements? what can i do? On my previous question I have already asked about randomising within a customised restriction and when that value is returned, I have to do an action depending on what it is. And each value has a different set of actions.


is it possible to change the way statements are executed in vb -
I just wanted to know a simple thing: If it possible to change the execution plan, the way vb executes the statements...can something like this be done: If x=1 then goto statement 10 else Nothing End if if the value of x is one then it should skip all the statements and go to


Audit trail of error SQL -
Hi there, I want to find out all the SQL statements that are failed[i.e produced error] against a particular database in SQL server. Is it possible? Lets say 1000 SQL statements are executed per day. I want to find out at the end of the day, which SQL statements have crashed.


[2005] # of nested program control statements - Rule of Thumb -
Hi all, I'm asking because I recently download some sample code from somewhere where there were so many nested statements that a lot of the code was running off the right side of the screen. I'm guessing there may be some times where you need a number of nested statements but is


case select -
Working with 'select case'. example : case 1 frmHelp.show statements case 2 frmBill.show statements case ... Now I'm executing the statements in case 1. On the form in case 1 I have a button 'next'. If I click on that button I want to execute the statements which are d


Performance SQL processing DAO/Access -
Hoi VB'ers I have written an app that will fill a access 97 database. I expect to execute 250000-350000 sql statements from a set of 30 i coded in my program. I'm using DAO because tests showed me that this is the fastest way to process the data/sql statements. From info f


If True Then.. -
hi all, hope this hasn't been covered before...I have searched without success I have (unfortunately) inherited a large, poorly commented, VB5 application which I have to debug & support. This code has a multitude of statements of the form below. If True Then ..sta


ADO: SQL Statements -
I can't find out how to use SQL statements with ADO. Can anybody point me towards any tutorials on this? Or give me a pointer?


no clue and vector spaces -
hey everyone well here's my prob: K is a Body, V is a vector space over K u,v,w are element of V Prove that the following statements are equivalent: (i) u,v,w are linearly dependent (ii) One of the following statements is true (1) v=0 (2) a element of K with w=a*v


SQL Variables -
I have a bunch of SQL statements that are bult in my program through several variables. I have heard that it is better and faster to put these SQL statements as stored proceedures in my database and call them from my program. My question is...is there a way to create a stored


combining tables or sql statements -
Greetings, Can anyone post a link or a code which tells you how to combine datatables or sql statements? Thanks


How to execute a sql file which has multiple sql statements -
hello, The problem is that I need to execute a sql file in which many sql statements are there.All I am going to specify in my Visual Basic code is the path of the input file. The file has to be taken as input and then the statements inside the file have to be executed one by one an


Does VB have these statements: On Error, On Break... -
Does VB have the following statements:


[2005] IDE Question -
Does .Net have, within the editor, some kind of graphical tool that draws lines to match If statements with their corresponding End If statements? Thanks,


DIM Statements. -
I need some help with variables and DIM statements - and how to use them in different ways. Any help is appreciated.


Function won't stop... even after it's form is unloaded! -
Alright... wierd deal. I have a public function on a form (a download progress form) that I call from another form. Now statements execute normally in that function... but if I click the close box the form unloads (I set the form = Nothing in the Form_Unload event) the statements st


adding a new field. -
Alright, well I am making a database system for some people, and ive completed a good chunk of it. now i just reliazed i needed to add another field in the database base. Say i have Name, ID,Email. i need to add "address"/ now I use SQL statements to work with my da


If Then Statements -
Can someone give me examples of If Then statements!!!


need help with SQL!! -
I need help changing some or all of my command statements to SQL statements. But I don't really know SQL!!! Can someone help me?


Easy Javascript question -
This ones probably so easy that you'll all cringe and think that i'm stupid. But being a learner of Javascript, it has to be asked. In VB there is the Select Case statement, and i think in C there is the Switch statement, which is a whole lot quicker than a heap of if then else state


Simple Array Question -
Exit Sub can also speed up execution time... say you have a function that assigns some number to a variable... you pass in x, and it shoots out y... but there are 750 variations... you would have 750 if..then statements... if your y is in the first one, its still going to compare all 7


Two Sql Statements -
Here is my situation: I have an asp page and I am first using a session variable. I am taking the User id of the person logged on and I am taking this info and searching the database for the last and first name. In the db I have the userid as a field and with it, a field named First


how to display multiple select statements in datagrid -
Hello, I am having a problem with displaying data in a datagrid . I am using ADO data control where i am using stored procedure having 2 select statements. when i try to set ADO datacontrol to the datagrid i am getting only the records from the first select statement. Can an


Too many if statements!! -
Hey Visual Basic.net people! I have one simple question for you. ~I had a basic game that i coded and there were soo many if statements! Is there a better way than to keep nesting? (Besides Select Case)


IF statements with AND or OR -
I know how to do IF statements in visual basic, but how do I incorporate AND and OR statements? ie, a simple if statement is: if UserForm.CheckBox1 = True Then statement End If But I want one that says: if UserForm.CheckBox1 = True or if UserForm1.CheckBox 2 = Tru


If statements with no event -
I need a way to have if statements checked without putting them in an objects event procedure. Run them from somewhere else while I'm using my form. Thanks, JO


Call Statements -
I'm working on a text-based game for my Computer Science class, and I've been having difficulty getting the concept of call statements. Can someone please explain them and how they work, or post a link that would do the same? Thanks in advance.


Basic For Statement help -
would this do an infinite loop? I know it's a pretty simple question. I just never really messed with For Statements atleast not the basic type. i've always requested help with more advanced For statements. For X = 1 To 0 extra code.... Next X thanks in advance.


Solved SQL Locking Problem -
Added in 'with (nolock)' to the select statements, used 2 machines to replicate the locks, viewed the locks using enterprise manager Management - Current Activity and changed sql statements accordingly.


Forward and Back buttons for SQL Queries -
Hi everyone, I currently have a program in place that allows the users to conduct sql statements on a MySQL database. I would like to institute a forward and back button into my program. I am just unsure how to start a list of what sql statements the user ran since the last login. D


Fast Pythagoras -
I'm looking for the fastest approximation of the Pythagorean Theorum in three dimensions. I have come up with one that has an average error of only a few percent, uses only the RISC subset of the Pentium instructions, and few total instructions. However, it also uses two IF statements.


Send queries by email to SQL 7 -
Someone told me that you can setup SQL 7 so that you can email SQL statements to it and it will return a recordset in email back to the sender based on those statements. If anyone can tell me what these are called so that I can get more information about them, I'd be greatly appreci


Closing Databases -
What is the best way to close an access database using DAO. I have two databases closing at the same time, db1 and db2, which are not local databases (ie on another computer on the network). We aren't using SQL server or anything like that here. The code i have is (strangely enough)


Making if statements "re-check" themselves -
I'm going to have a preferences section on my program, basicly it will be mostly true or false statements. My question is, say I have a couple of events with if statements which check to see if certain options are enabled. Later on, someone opens the preferences and changes an optio


Generating SQL script from Access -
I am wanting to generate from Access 2000 a series of SQL Statements that show the insert statements for data in an Access table. Is there a function in access that does this? Or anything else?


Is there a VB equivalent to the READ & DATA statements -
If anyone can help me, I'm trying to convert a QuickBasic4.5 program to VB6 and the one thing tripping me up is that I can't seem to get READ and DATA statements to work . . . mikeycorn