Getdate() and time comparison
Hi all, I've SBO and I'm trying to create a query, based on OQUT table, showing DocNum WHEN time of creation of the offer is less then 15 minutes than System time. I'm trying to compare DocTime and the time extracted with getdate() but I'm not able to do it. I think it's a problem of data type.
Is there anybody who can help me?
Thanks in advance
Hi Federico,
You're correct, it's not possible to directly use DocTime for date comparisons because it's held as an integer value and not a DateTime value. You can do a little conversion though. Have a look here:
Re: GetDate() in query generator doesn' return the time!
Kind Regards,
Owen
Similar Messages
-
Date and Time comparisons...
Hi! and regards to all.... I´m trying to get the interval from a table depending on current date and time (sysdate), but i´m having problems when comparing date where first one is greater than second one...
My table is defined and populated as...
HRA_ID HRA_INTERV HRA_INICIO HRA_FIN
1 15 01/01/2008 08:00:00 a.m. 01/12/2020 10:00:00 p.m.
2 30 01/01/2008 10:01:00 p.m. 01/12/2020 07:59:00 a.m.
Whend doing comparison between 8:00am to 10:00pm no problem is found and the data 15 is returned... but when comparing in the second interval (10:01pm to 7:59am next day) problems are come.. I supose is because of different days are considered in my sql statement... nevertheless i would like to receive comments...
My sql statement is:
SELECT HRA_INVERV
FROM UBI_HORARIOS A
WHERE TO_DATE(TO_CHAR(SYSDATE,'HH24:MI:SS'),'HH24:MI:SS')
BETWEEN (TO_DATE(TO_CHAR(A.HRA_INICIO,'HH24:MI:SS'),'HH24:MI:SS'))
AND
(TO_DATE(TO_CHAR(A.HRA_FIN,'HH24:MI:SS'),'HH24:MI:SS'))
Your suggestions are welcome...Thanks Justin!!, and EXACTLY!!!... That was the first error I found when my supervisors gave me the database ralational diagram... But in this case fields with data type TIME are not allowed.. So, what I´m trying to to is trim the date parte of the field (01/01/2008, etc,etc) and JUST USE TIME INTERVALS... That´s why I´m using to_char and to_date... in order to ELIMINATE DATE PARTS AND USE JUST THEIR TIME PERIODS... But being honest.. i don´t know if there´s another function could help...
-
Hi,
I am trying to get the difference between two sets of time.
This also involves a Date comparison because sometimes the times span more than one day.
Here is an example of what I'm trying to accomplish. I have searched the forum archives but have not yet found time and date comparisons together.
startRun = "10/26/01 4:30 PM";
endRun = "10/27/01 7:45PM";
I want to process these two times and get the difference.
The result would be:
totalRunTime = "27 hours 15 minutes";
I am stumped. Is this type of process even possible? Any help would be grealty appreciated.
Best,
Christian Velez
Senior Software Engineer
Research Institute of America, Inc.
[email protected]try this ...
String startRun = "10/26/01 4:30PM";
String endRun = "10/27/01 7:45PM";
SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy hh:mma");
try {
Date startDate = sdf.parse(startRun);
Date endDate = sdf.parse(endRun);
System.out.println("Start date/time = " + startDate);
System.out.println("End date/time = " + endDate);
long differenceInMillis = endDate.getTime() - startDate.getTime();
long differenceInSecs = differenceInMillis / (1000);
long differenceInMins = differenceInMillis / (1000 * 60);
long differenceInHours = differenceInMillis / (1000 * 60 * 60);
System.out.println("Millis = " + differenceInMillis);
System.out.println("Seconds = " + differenceInSecs);
System.out.println("Minutes = " + differenceInMins);
System.out.println("Hours = " + differenceInHours);
//What you want
System.out.println("Total run time = "
+ differenceInHours + " hours "
+ (differenceInMins % 60) + " minutes");
} catch (ParseException pe) {
} -
Comparisons of Duration, Date and Time Values
Hello,
Is there way to simulate support for XPath 2.0 date/time comparison functions?
(can I create a module to replace currently available XPath functions with my
own?)
Are there plans to fully support those functions?
For example: func-date-less-than
http://www.w3.org/TR/xquery-operators/#func-date-less-than
... snip ...
( time-less-than( time("12:00:00"), time("23:00:00+06:00") ) )
... snip ...
Regards,
Benjamin Shrom.Just use lt on the dates, dateTime and time elements
<db>
for $PB_BB.CUSTOMER_1 in document("PB-BB")/db/CUSTOMER
where ($PB_BB.CUSTOMER_1/CUSTOMER_SINCE lt $#customer_since_cutoff of type
xs:date)
return
<CUSTOMER>
<CUSTOMER_ID>{ xf:data($PB_BB.CUSTOMER_1/CUSTOMER_ID) }</CUSTOMER_ID>
</CUSTOMER>
</db>
- Mike
"Benjamin Shrom" <[email protected]> wrote:
>
Hello,
Is there way to simulate support for XPath 2.0 date/time comparison functions?
(can I create a module to replace currently available XPath functions
with my
own?)
Are there plans to fully support those functions?
For example: func-date-less-than
http://www.w3.org/TR/xquery-operators/#func-date-less-than
... snip ...
( time-less-than( time("12:00:00"), time("23:00:00+06:00") ) )
... snip ...
Regards,
Benjamin Shrom. -
How do I get date and time component from a DATE object?
Hi All,
I need to get date and time separately from a DATE object, does
anyone know what function I should call? GetDate()? GetTime()?
I need this in a SELECT statement.
Thanks in advance and looking forward to your early reply.
Regards.
Gladywin
30/11/2001Hello,
See following SQL.
select to_char(sysdate,'dd/mm/rrrr') today_date,
to_char(sysdate,'hh24:mi') now_time
from dual
Adi -
Hi,
I am working on a validation script to get the list of hotfixes installed on Domain Controllers every month as part of our monthly DC patching process. I have been successful in getting these details for DC's with (Windows Server 2008
R2 SP1, Powershell v2.0) using the below command.
Get-HotFix -cn $computer | Select-Object PSComputerName,HotFixID,Description,InstalledBy,InstalledOn | where InstalledOn -ge (Get-Date -Day 1 -Format d) | FT -AutoSize
I execute the above from a jump box with powershell v4.0 (Server 2008 R2)
However, when I try the same command from the jump box to query DC's with (Server 2008 SP2, powershell v2.0). It doesn't return the InstalledOn date and time. It was giving error for the InstalledOn property and hence I renamed it to $_.InstalledOn. Now
I don't get error but still no details displayed for InstalledOn property.
I tried using the below, as could see on few forums that this might resolve the issue. I also tried removing the "where" part but still no installation date returned.
Get-HotFix -cn $computer | Select-Object HotFixID, Description, InstalledBy, @{l="InstalledOn";e={[DateTime]::Parse($_.psbase.properties["installedon"].value,$([System.Globalization.CultureInfo]::GetCultureInfo("en-US")))}}
| where {$_.InstalledOn -ge (Get-Date -Day 1 -Format d)} | FT -AutoSize
Have tried this locally on the 2008 SP2 DC but still not working. Please advise what is going wrong?
Note: If I execute the below command locally on the 2008 SP2 DC, I am getting the InstalledOn output. However, when executed from the jump box with powershell v4.0 (Server 2008 R2) to query
the same 2008 SP2 DC, it just gives the prompt again without any error or output. This behavior is consistent for other 2008 SP2 DC's in the environment.
Get-HotFix -cn $computer | Select-Object HotfixID,Description,InstalledBy,InstalledOn | where {$_.InstalledOn -ge (Get-Date -Day 1 -Format d)} | FT -AutoSizeHi jrv, I have already tried the Win32_QuickFixEngineering option, which doesn't work either. Apologies for not mentioning the workarounds that I have already tried.
Get-Hotfix seems to be just a wrapper for Win32_QuickFixEngineering as per the below article. (http://technet.microsoft.com/en-us/library/hh849836.aspx)
I have seen a mention of using the WU ActiveX control on few forums, but was too lazy to read it through.
After rigorous testing, it makes me realize that somewhere the Get-Hotfix dates formatting\comparison isn't working. -
How To insert Day And Time In flash AS2?
I want to display Day and time in flash with AS2
not only that i want to put certain event on certain date and time
that means
i have a movie clip with object on it ,when i run it,
it changes its position
BUT now i want to change movie clip position on certain date and time
for eg;
I have made a simple move clip of firework i want it auto play when it is
(01.01.2012) (12:00 AM)
Help Me.....user time is easiest. the following checks if it's between 12am and 1am jan 1, 2012.
var d:Date=new Date();
if(d.getMonth()==0&d.getDate()==1&&d.getFullYear()==2012&&d.getHours()<1){
// fireworks -
What is the best way to captue current date and time?
I got a field in table to capute current date and time...i am
using SQL Server.
field name datatype length
enter_datetime datetime 8
What is the best way to get current date and time and insert
to table?.
Is this way?.
<cfset curtime = 'dateformat(#now()#,'mm/dd/yyyy')&"
"&timeformat(#now()#,'hh:mm:ss')'>
This way looks like time is not entered correctly.
or any other better way?.> get current date and time and insert to table?
You can use cfqueryparam
<cfqueryparam value="#now()#"
cfsqltype="cf_sql_timestamp">
Or as was suggested, set the default for your table column to
getdate(). Then you won't have to insert anything. Sql server will
do it automatically when a new record is created. -
Dear Friends,
I need your valuable suggestion to proceed.
Functional Flow :-
My client will have a Construction project with a budgeted hours to finish and the Manager will assign Employees to this project. they need to know all the budgted hours are allocated to Employees to finish the work.
Technical
for example the budgeted hour will be in the format of 50:30 (Means 50 hrs and 30 minutes) and Workers will be allocated to this project like
Monday 8:00 to 17:15
Tuesday 9:00 to 16:45
Tables := Projects Column Budgeted_hours varchar2(6)
Assignments Column Allocated_hours varchar2(6)
My question is how to compare the budgeted hours and allocated_hours of the workers to see whether all the budgeted hours are allocated to workers as I am storing these all values in Varchar2. Why I am using Varchar2 is that, they want to have this ':' sign with time slot.
Can anyone help me how to do this. Whether I need to change varchar to Date ? if so the data will be inserted with date and time which is not correct for this situvation. Need help
Please write to me at [email protected]
Regards
SJK
thanks
SjkI would suggest you store elapsed time as a number of days e.g. 50:30 hours = 50.5/24 days = 2.1041666667 days. You'd need to write some simple PL/SQL database functions to parse and convert data between the numeric stored format and the desired input/output character format. The reasons for this are
1) arithmetic becomes simple e.g. adding another 8 hours to the budgeted 50.5 hours
2) where appropriate, it coincides with Oracle's way of handling date arithmetic (the difference between two DATEs is a NUMBER of days.
If you can determine an employee's total number of allocated hours, then the comparison you mentioned becomes easy: unallocated = budgeted - allocated. You can also
Your problem introduces lots of complexity due to the fact that a project day is not the same as a 24 hour calendar day (e.g. employee shift is only 8 hours, 5 days a week). Any calculation involving start or end dates will have to take the project calendar and work shifts into account. I suggest you invest some deep thought into the fundamental data manipulations needed by your project, and create a package of simple functions and procedures to form the foundation for higher level operations. Here's one example:
FUNCTION SHOW_AS_HHMM (p_durn IN NUMBER) RETURN VARCHAR2 IS
l_hours_n NUMBER;
l_hours_c VARCHAR2(16);
l_minutes_c VARCHAR2(2);
BEGIN
-- convert days into hours
l_hours_n := p_durn * 24;
-- convert hours into characters
l_hours_c := to_char (trunc (l_hours_n));
-- convert fraction of hours into minutes characters
l_minutes_c := to_char (round ((l_hours_n - trunc (l_hours_n)) * 60));
return l_hours_c || ':' || l_minutes_c;
EXCEPTION
WHEN OTHERS THEN
raise;
END show_as_hhmm; -
Hi There
I am trying to create a time comparison for a website I am building.
I have the following so far
<?php
$date=$_POST ['daydropdown'];
$month=$_POST ['monthdropdown'];
$year=$_POST ['yeardropdown'];
$datevalue="$date/$month/$year";
$booking=strtotime ("now + 24 hours");
if ($date_value > $booking)
echo ("lovey");
else
echo ("tut tut");
?>
which is pulling its date info from
<form action="timetest.php" method="post">
<table>
<tr>
<td class="tableheight">
Party Size</td>
<td>
<select name="partysize" size="1" id="partysize">
<option>1</option>
<option selected="selected">2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
<option>11</option>
<option>12</option>
<option>13</option>
<option>14</option>
<option>15</option>
<option>16</option>
<option>17</option>
<option>18</option>
<option>19</option>
<option>20</option>
</select>
</td>
</tr>
<tr>
<td class="tableheight">Date</td>
<td>
<select name="daydropdown" id="daydropdown">
</select>
<select name="monthdropdown" id="monthdropdown">
</select>
<select name="yeardropdown" id="yeardropdown">
</select>
</td>
</tr>
<tr>
<td class="tableheight">Time</td>
<td><select name="time">
<option>12 noon</option>
<option>12:15pm</option>
<option>12:30pm</option>
<option>12:45pm</option>
<option>1:00pm</option>
<option>1:15pm</option>
<option>1:30pm</option>
<option>1:45pm</option>
<option>2:00pm</option>
<option>2:15pm</option>
<option>2:30pm</option>
<option>2:45pm</option>
<option>3:00pm</option>
<option>3:15pm</option>
<option>3:30pm</option>
<option>3:45pm</option>
<option>4:00pm</option>
<option>4:15pm</option>
<option>4:30pm</option>
<option>4:45pm</option>
<option>5:00pm</option>
<option>5:15pm</option>
<option>5:30pm</option>
<option>5:45pm</option>
<option>6:00pm</option>
<option>6:15pm</option>
<option>6:30pm</option>
<option>6:45pm</option>
<option>7:00pm</option>
<option>7:15pm</option>
<option>7:30pm</option>
<option>7:45pm</option>
<option>8:00pm</option>
<option>8:15pm</option>
<option>8:30pm</option>
<option>8:45pm</option>
<option>9:00pm</option>
<option>9:15pm</option>
</select></td>
</tr>
<tr>
<td class="tableheight">First Name</td>
<td><input name="firstname" type="text" placeholder="Your First Name" /></td>
</tr>
<tr>
<td class="tableheight">Surname</td>
<td><input name="surname" type="text" placeholder="Your Last Name"/></td>
</tr>
<tr>
<td class="tableheight">Email Address</td>
<td><input name="email" type="email" placeholder="Your Email Address"/></td>
</tr>
<tr>
<td class="tableheight">Confirm Email </td>
<td><input name="confirm" type="email" placeholder="Confirm Email"/></td>
</tr>
<tr>
<td class="tableheight">Contact Number</td>
<td><input name="contactnumber" type="text" placeholder="Your Contact Number"/></td>
</tr>
<tr>
<td style="padding-top:0px"><input name="Book Now" type="submit" value="Book Now" /></td>
<td></td>
</tr>
</table>
</form>
<script type="text/javascript">
//populatedropdown(id_of_day_select, id_of_month_select, id_of_year_select)
window.onload=function(){
populatedropdown("daydropdown", "monthdropdown", "yeardropdown")
</script>
What I want to happen is if a booking for a table is made for more than 24hours in advance then its fine and sends the reservation to the restaurant aka "Lovely" where as if its for within the next 24 hours then "tut tut" they are told to ring the restaurant.
Does anyone have any pointers for me please.
GYou need to change the $datevalue variable to a timestamp like you did with $booking.
$dateTried = strtotime($datevalue);
Then you can compare them.
if ($dateTried < $booking) { // this is what to do if the time chosen was within 24 hours } else { // this is what to do if the time chosen was a valid value (24 hours or more from current time) }
BTW, it looked like your form fields are populated using JavaScript. If I were you I would switch that to be PHP driven. The code will be very similar in PHP as your JavaScript code, but it will work for all your visitors, not just the ones that have JavaScript enabled.
-Jason
Sorry the code didn't line up. I used the wrong code insert options.
Message was edited by: UteFanJason -
Database time comparisons from RAT
I am using Real Application Testing to test moving to a new server and I am a little confused on the “database time” comparisons. I ran the capture for 5 minutes and 54 seconds, the database time for the CAPTURE shows 33 minutes and 29 seconds, when I replayed it the REPLAY shows database time for 6:09 but the actual duration was only 5:57.
So this tells me that it took about the same amount of time to play back the workload but I don’t understand the database time. Can somebody help me out with this? Thanks.I have not done RAT but my guess is the CAPTURE time is the cumulative time consumed by sessions on database for the given workload.
-
Time of song and Time elapsed on a MP3 player
I cant figure out how i make a time of song and time elapsed line. I all ready made the mp3 player.
Here is the AC3 code. If anyone can help me with this i would be a very happe man.
package {
import fl.controls.DataGrid;
import fl.data.DataProvider;
import flash.data.SQLConnection;
import flash.data.SQLStatement;
import flash.desktop.Clipboard;
import flash.desktop.ClipboardFormats;
import flash.desktop.NativeDragManager;
import flash.display.MovieClip;
import flash.display.NativeWindow;
import flash.display.NativeWindowInitOptions;
import flash.display.NativeWindowSystemChrome;
import flash.display.NativeWindowType;
import flash.display.SimpleButton;
import flash.display.Sprite;
import flash.display.Stage;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.events.NativeDragEvent;
import flash.events.TimerEvent;
import flash.filesystem.File;
import flash.filters.DropShadowFilter;
import flash.media.ID3Info;
import flash.media.Sound;
import flash.media.SoundChannel;
import flash.media.SoundMixer;
import flash.media.SoundTransform;
import flash.net.URLRequest;
import flash.text.TextField;
import flash.utils.Timer;
public class AudioGear extends Sprite
private var connect:SQLConnection;
private var currentSound:Sound;
private var yOffset:Number;
private var st:SoundTransform;
private var nw:NativeWindow;
private var window:MovieClip;
private var tracer:int;
private var channel:SoundChannel;
private var tfText:String;
private var len:int;
public function AudioGear()
init();
listeners();
private function init():void
initDB();
buildWindow();
initObjects();
private function initObjects():void
background.mouseEnabled = true;
playToggle.buttonMode = true;
playToggle.mouseChildren = false;
tf.background = true;
tf.backgroundColor = 0x000000;
tf.mouseEnabled = false;
tf.text = "Drag MP3 file here";
prevBtn.buttonMode = true;
playBtn.buttonMode = true;
nextBtn.buttonMode = true;
st = new SoundTransform(1, 0);
channel = new SoundChannel();
try {
currentSound = new Sound(new URLRequest(window.grid.getItemAt(0).Location));
catch(event:Error)
private function initDB():void
var file:File = File.applicationStorageDirectory.resolvePath("playlist.db");
connect = new SQLConnection();
connect.open(file);
var statement:SQLStatement = new SQLStatement();
statement.sqlConnection = connect;
statement.text = "CREATE TABLE IF NOT EXISTS PLAYLIST (Artist TEXT, Song TEXT, Location TEXT)";
statement.execute();
private function listeners():void
closer.addEventListener(MouseEvent.CLICK, handleWindow);
mini.addEventListener(MouseEvent.CLICK, handleWindow);
background.addEventListener(MouseEvent.MOUSE_DOWN, moveWindow);
playToggle.addEventListener(MouseEvent.CLICK, togglePlayList);
volControl.slider.addEventListener(MouseEvent.MOUSE_DOWN, sliderDown);
prevBtn.addEventListener(MouseEvent.CLICK, buttonClick);
playBtn.addEventListener(MouseEvent.CLICK, buttonClick);
nextBtn.addEventListener(MouseEvent.CLICK, buttonClick);
this.addEventListener(NativeDragEvent.NATIVE_DRAG_ENTER, dragEnter);
private function moveWindow(event:MouseEvent):void
stage.nativeWindow.startMove();
private function handleWindow(event:MouseEvent):void
if(event.target == closer)
stage.nativeWindow.close();
nw.close();
else
stage.nativeWindow.minimize();
nw.minimize();
private function sliderDown(event:MouseEvent):void
volControl.slider.removeEventListener(MouseEvent.MOUSE_DOWN, sliderDown);
stage.addEventListener(MouseEvent.MOUSE_MOVE, sliderMove);
stage.addEventListener(MouseEvent.MOUSE_UP, sliderUp);
yOffset = mouseY - event.target.y;
private function sliderMove(event:MouseEvent):void
var mc:MovieClip = volControl.slider;
mc.y = mouseY - yOffset;
if(mc.y <= 0)
mc.y = 0;
else if(mc.y >= (100))
mc.y = (100);
updateVolume(mc.y);
event.updateAfterEvent();
private function sliderUp(event:MouseEvent):void
stage.removeEventListener(MouseEvent.MOUSE_MOVE, sliderMove);
stage.removeEventListener(MouseEvent.MOUSE_UP, sliderUp);
volControl.slider.addEventListener(MouseEvent.MOUSE_DOWN, sliderDown);
private function updateVolume(num:Number):void
var vol:Number = (100 - (num*1))/50;
SoundMixer.soundTransform = st;
st.volume = vol;
private function dragEnter(event:NativeDragEvent):void
this.removeEventListener(NativeDragEvent.NATIVE_DRAG_ENTER, dragEnter);
this.addEventListener(NativeDragEvent.NATIVE_DRAG_DROP, dragDrop);
this.addEventListener(NativeDragEvent.NATIVE_DRAG_EXIT, dragExit);
var clip:Clipboard = event.clipboard;
var object:Object = clip.getData(ClipboardFormats.FILE_LIST_FORMAT);
tfText = tf.text;
if (object[0].extension.toLowerCase() == "mp3")
NativeDragManager.acceptDragDrop(this);
tf.text = "Drop it";
else
tf.text = "Not a MP3 file";
private function dragExit(event:NativeDragEvent):void
this.addEventListener(NativeDragEvent.NATIVE_DRAG_ENTER, dragEnter);
this.removeEventListener(NativeDragEvent.NATIVE_DRAG_EXIT, dragExit);
tf.text = tfText;
private function dragDrop(event:NativeDragEvent):void
this.removeEventListener(NativeDragEvent.NATIVE_DRAG_EXIT, dragExit);
this.addEventListener(NativeDragEvent.NATIVE_DRAG_ENTER, dragEnter);
this.removeEventListener(NativeDragEvent.NATIVE_DRAG_DROP, dragDrop);
var clip:Clipboard = event.clipboard;
var object:Object = clip.getData(ClipboardFormats.FILE_LIST_FORMAT);
var req:URLRequest = new URLRequest(object[0].url);
var sound:Sound = new Sound();
sound.addEventListener(Event.COMPLETE, soundLoaded);
sound.load(req);
tf.text = "LOADING...";
private function soundLoaded(event:Event):void
currentSound = event.target as Sound;
var id:ID3Info = currentSound.id3;
var artist:String = id.artist;
var song:String = id.songName;
var url:String = currentSound.url
var statement:SQLStatement = new SQLStatement();
statement.sqlConnection = connect;
statement.text = "INSERT INTO PLAYLIST (Artist, Song, Location) VALUES (?, ?, ?)";
statement.parameters[0] = artist;
statement.parameters[1] = song;
statement.parameters[2] = url;
statement.execute();
loadData();
window.grid.selectedIndex = len-1;
tracer = -1;
tf.text = "Thank you";
var timer:Timer = new Timer(1000);
timer.addEventListener(TimerEvent.TIMER, onTimer);
timer.start();
private function onTimer(event:TimerEvent):void
if(tf.text == "THANK YOU!")
tf.text = tfText;
var timer:Timer = event.target as Timer;
timer.stop();
private function loadData():void
var statement:SQLStatement = new SQLStatement();
statement.sqlConnection = connect;
statement.text = "SELECT * FROM PLAYLIST";
statement.execute();
try
var dp:DataProvider = new DataProvider(statement.getResult().data);
window.grid.dataProvider = dp;
catch(event:Error)
len = window.grid.length;
private function buttonClick(event:MouseEvent):void
var mc:MovieClip = event.target as MovieClip;
var string:String = mc.name;
switch(string)
case "playBtn" :
if(mc.currentLabel == "play")
try
playSong(currentSound.url);
catch(event:Error)
else
mc.gotoAndStop("play");
SoundMixer.stopAll();
break;
case "nextBtn" :
playNextSong();
break;
case "prevBtn" :
playPrevSong();
break;
private function playNextSong():void
if(tracer == len)
tracer = 0;
else
tracer++;
handleNextPrev();
private function playPrevSong():void
if(tracer == 0)
tracer = len;
tracer--;
handleNextPrev();
private function handleNextPrev():void
var string:String;
try
string = window.grid.getItemAt(tracer).Location;
currentSound = new Sound(new URLRequest(string));
SoundMixer.stopAll();
playSong(string);
catch(event:Error)
string = window.grid.getItemAt(0).Location;
currentSound = new Sound(new URLRequest(string));
SoundMixer.stopAll();
playSong(string);
private function playSong(string:String):void
try {
playBtn.gotoAndStop("stop");
for(var i:int; i<len; i++)
if(string == window.grid.getItemAt(i).Location)
tracer = i;
window.grid.selectedIndex = i;
var object:Object = window.grid.getItemAt(tracer);
if(object.Artist == null)
object.Artist = "";
if(object.Song == null)
object.Song = "";
tf.text = object.Artist + " - " + object.Song;
channel = currentSound.play();
channel.addEventListener(Event.SOUND_COMPLETE, onSoundComplete);
catch(event:Error)
private function onSoundComplete(event:Event):void
playNextSong();
private function togglePlayList(event:MouseEvent):void
if(playToggle.ty.text == "Show Playlist")
loadData();
setCoords();
nw.visible = true;
window.grid.selectedIndex = tracer;
playToggle.ty.text = "Hide Playlist";
else
nw.visible = false;
playToggle.ty.text = "Show Playlist";
private function buildWindow():void
var nwo:NativeWindowInitOptions = new NativeWindowInitOptions();
nwo.maximizable = false;
nwo.resizable = false;
nwo.transparent = true;
nwo.systemChrome = NativeWindowSystemChrome.NONE
nwo.type = NativeWindowType.LIGHTWEIGHT;
nw = new NativeWindow(nwo);
nw.title = "Playlist";
window = new Window();
window.deli.ty.text = "Delete";
window.mouseEnabled = false;
window.addEventListener(MouseEvent.MOUSE_DOWN, moveNatWin);
nw.stage.stageWidth = window.width+10;
nw.stage.stageHeight = window.height+10;
nw.stage.scaleMode = StageScaleMode.NO_SCALE;
nw.stage.align = StageAlign.TOP_LEFT;
window.filters = [new DropShadowFilter(4, 90, 0x000000, 1, 4 ,4, 0.66, 3)];
window.x = 5;
window.y = 0;
nw.stage.addChild(window);
setCoords();
window.grid.addEventListener(Event.CHANGE, gridChange);
window.deli.addEventListener(MouseEvent.CLICK, deliClick);
loadData();
private function setCoords():void
nw.x = stage.nativeWindow.x;
var theY:Number = (stage.nativeWindow.y + stage.nativeWindow.height)
nw.y = theY;
private function deliClick(event:MouseEvent):void
try
var statement:SQLStatement = new SQLStatement();
statement.sqlConnection = connect;
statement.text = "DELETE FROM PLAYLIST WHERE Location = ?";
statement.parameters[0] = window.grid.selectedItem.Location;
var string:String = window.grid.selectedItem.Location;
var item:int = window.grid.selectedIndex;
statement.execute();
loadData();
if(currentSound.url == string)
currentSound = new Sound(new URLRequest(window.grid.getItemAt(0).Location));
len = window.grid.length;
try
window.grid.selectedItem = window.grid.getItemAt(item-1);
catch(event:Error)
window.grid.selectedItem = window.grid.getItemAt(0);
} catch (event:Error) {
private function gridChange(event:Event):void
var dg:DataGrid = event.target as DataGrid;
currentSound = new Sound(new URLRequest(dg.selectedItem.Location));
private function moveNatWin(event:MouseEvent):void
var mc:MovieClip = event.target as MovieClip;
var st:Stage = mc.parent.parent as Stage;
st.nativeWindow.startMove();Hello there,
You're in the forum for Acrobat.com. We can't help with questions about other products; I'm not sure what you're using for your project, but it's not likely you'll find the help you're looking for in this particular forum. Sorry!
Rebecca -
Stored Procedure using Date/Time Comparison
I’m running SQL Server 2012. I need to write a procedure that will send out emails based on a date/time comparison.
In my table, ‘tickets’, I have a smalldatetime column ‘ticket_date’ and another column ‘responded’ which is a bit field. I need to check the current date to see if 24 hours has passed from the ticket_date. If 24 hours has passed and responded is 0, then
I need to email a manager ( I already have the code for emailing with SMTP).
The next step is to see if 48 hours has passed from the ticket_date and if responded is 0.
If this is true, then I need to email someone else.
I don’t want to include weekends in my time comparison. My procedure will only run Mon – Fri.
Thanks in advance!Check the below sample and hope this will help you:
DECLARE @Tickets TABLE (TicketID INT, TicketDate SMALLDATETIME, Responded BIT)
INSERT INTO @Tickets
SELECT 1, '01/10/2015 10:00AM', 0 UNION ALL
SELECT 2, '01/13/2015 12:00PM', 1 UNION ALL
SELECT 3, '01/12/2015 05:30PM', 0 UNION ALL
SELECT 4, '01/09/2015 08:00AM', 1
SELECT *, '24 Hour' AS TicketCase
FROM
@Tickets
WHERE
Responded = 0
AND DATEDIFF(HOUR, TicketDate, CURRENT_TIMESTAMP) <= (CASE DATEPART(WEEKDAY, TicketDate) WHEN 7 THEN 48 WHEN 1 THEN 24 ELSE 0 END) + 24
UNION ALL
SELECT *, '48 Hour' AS TicketCase
FROM
@Tickets
WHERE
Responded = 0
AND DATEDIFF(HOUR, TicketDate, CURRENT_TIMESTAMP) >= 24
AND DATEDIFF(HOUR, TicketDate, CURRENT_TIMESTAMP) <= (CASE DATEPART(WEEKDAY, TicketDate) WHEN 7 THEN 48 WHEN 1 THEN 24 ELSE 0 END) + 48
Output
TicketID | TicketDate | Responded | TicketCase
3 | 2015-01-12 17:30:00 | 0 | 24 Hour
1 | 2015-01-10 10:00:00 | 0 | 48 Hour
You can make the separate SQL statements and email to proper people based on 24 hour or 48 hour case.
Best Wishes, Arbi; Please vote if you find this posting was helpful or Mark it as answered. -
Backing up photos on iMac using external hard drive and time machine
How do i back up photos from my imac using an external hard drive and time machine
Thanks in advanceApple explains how to use Time Machine in http://support.apple.com/kb/ht1427.
Setting up and using TM is very simple to do, connect any external HD (format as Mac OS Extended (Journaled) using Disk Utility ) and your computer shoudl ask if you want to use that EHD for a Time Machine backup. If you have any questions visit your local Apple Store or reseller and they can answer how to setup and use TM and also should be able to offer suggestions on EHDs. My personal preference is OWC (www.macsales.com) Mercury Elite Pro due to the build quality and OWC's level of support. -
I have been using a Mac Mini with an external hard and Time Machine. I bought an Airport Extreme and have had problem setting up the hard drive using the USB port on the Airport Extreme. I also just recently bought a Mac Book Air and hope to have both computers back up to the external hard drive using Time Machine and Airport Extreme. I have been using the optical drive from the Mac mini to load programs into the Mac Book Air. I think I'm just getting confused in Finder. I am just not seeing the hard drive. I ended up plugging the hard drive back into the Mac Mini and that is work fine again. How do I setting the external hard drive up to the AirPort Extreme and use for both computers? Or at least to start with the Mac mini.
It's critical to understand that Time Machine (TM) stores backups differently between local and network drives. That would mean the TM backup on your locally attached USB hard drive will not be directly useable when it is connected to the AirPort Extreme Base Station (AEBS). There is a way to copy a local version to a network version, but it is not fool-proof. When you do connect this drive and point TM to it, TM will start a brand new backup, leaving your existing backup as is.
If your current backup is critical to you, you may want to consider getting a second USB drive to attach to the Extreme and use your existing one as a backup ... or use TM's multi-backup process to backup to more than one destination drive alternatively.
So, at this point, you may want to make a decision on how you want to go forward to help provide a solution for you.
To directly answer your question, when you go to select a destination for a Time Machine backup, the drive(s) that show up under "Backup Disks" are those that TM already recognizes and has backed up to. Those listed under "Available Disks" are drives (either local or on the network) that TM can back up to.
Maybe you are looking for
-
IPod no longer Authorized, since OS 4.3 upgrade
A little bit of history first- iPod touch is 1 year old (3rd gen). Until a week ago, I have had no problems syncing it with iTunes. All of a sudden, after the iOS 4.3 upgrade, next time I connected for Sync, I get: This computer is no longer authoriz
-
Form Returns Null Values or Empty Values For Variables After Clicking OK Button
I'm trying to create a new user based on a template user. Right now I just want to get the variables right, I just want to be able to select a template user, fill in the information that will be different, and click Create User. I'm not sure why thi
-
Why clips copied not linked in 10.1?
I am confused by the media handling of FCPX 10.1. Goal: On the one hand a library on disk-1 containing the project, on the other hand disk-2 containing the event with the clips. But when I procees with this, the original media are copied into the pro
-
HP Photosmart Pro B9180 - print problem - color
The photo output is not the correct color. I tried cleaning and calibartaing but tere does not seem to be magenta printing. the reoprt says the printhead is oK, but it is not printing correctly ? Any ideas ?
-
IPhoto not displaying all imported photos
Hi! I am having trouble viewing all of my photos in iPhoto. They are all in my iCloud, and they appear in that photo stream. However, after I have imported *ALL* of my photos from my iPhone, iPhoto is only displaying some of them. It seems like there